import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.StringTokenizer; public class SocialDistancingInCinema { static final int[][] forbiddenNeighbors = { {-4, -3, -2, -1, 0, 1, 2, 3, 4,}, // -9 {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5,}, // -8 {-7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7,}, // -7 {-7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7,}, // -6 {-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8,}, // -5 {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,}, // -4 {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,}, // -3 {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,}, // -2 {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,}, // -1 {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,}, // 0 {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,}, // 1 {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,}, // 2 {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,}, // 3 {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,}, // 4 {-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8,}, // 5 {-7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7,}, // 6 {-7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7,}, // 7 {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5,}, // 8 {-4, -3, -2, -1, 0, 1, 2, 3, 4,}, // 9 }; static final int[] length = {9, 11, 15, 15, 17, 19, 19, 19, 19, 19, 19, 19, 19, 19, 17, 15, 15, 11, 9}; private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); private static final PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); private static StringTokenizer st; private static int readInt() throws IOException { while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine()); return Integer.parseInt(st.nextToken()); } public static void main(String[] args) throws IOException { ArrayList answer = solve(); pw.println(answer.size()); for (int i : answer) { pw.println(i + " "); } pw.close(); } private static ArrayList solve() throws IOException { int N = readInt(); int[][] index = new int[518][518]; boolean[][] present = new boolean[518][518]; // 0 safe, 1 to check, 2 forbidden for (int i = 1; i <= N; i++) { int x = readInt() + 8; int y = readInt() + 8; index[x][y] = i; present[x][y] = true; } ArrayList selected = new ArrayList<>(); for (int i = 9; i <= 508; i++) { for (int j = 9; j <= 508; j++) { if (present[i][j]) { selected.add(index[i][j]); for (int k = 0, r = -9; k < 19; k++, r++) { for (int l = length[k] - 1; l >= 0; l--) { present[i + r][j + forbiddenNeighbors[k][l]] = false; } } } } } return selected; } }