using System;
using System.Collections.Generic;
class main
{
public static void Main(string[] args)
{
var n = Int32.Parse(Console.ReadLine());
List<int> res = new List<int>();
for (int i = 0; i < n; i++)
{
var line = Console.ReadLine().Split(' ');
int time = Int32.Parse(line[0]);
int cellId = Int32.Parse(line[1]);
int callId = Int32.Parse(line[2]);
int gridIdX = Int32.Parse(line[3]);
int gridIdy = Int32.Parse(line[4]);
int rsrp = Int32.Parse(line[5]);
if (i % 10 == 0) res.Add(i + 1);
}
System.Console.WriteLine(res.Count);
for(int i = 0; i < res.Count; ++i)
{
System.Console.Write("{0} ", res[i]);
}
System.Console.WriteLine();
}
}