import java.util.*;
import java.io.*;
public class main
{
public static void main(String args[]) throws IOException
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(reader.readLine());
List<Integer> res = new ArrayList<Integer>();
for (int i = 0; i < n; i++)
{
StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
int time = Integer.parseInt(tokenizer.nextToken());
int cellId = Integer.parseInt(tokenizer.nextToken());
int callId = Integer.parseInt(tokenizer.nextToken());
int gridIdX = Integer.parseInt(tokenizer.nextToken());
int gridIdY = Integer.parseInt(tokenizer.nextToken());
int rsrp = Integer.parseInt(tokenizer.nextToken());
if (i % 10 == 0) res.add(i + 1);
}
System.out.println(res.size());
for (int i = 0; i < res.size(); i++)
{
System.out.print(res.get(i) + " ");
}
System.out.println();
}
}