def in_10(x1, y1, x2, y2): return (x1 - x2) ** 2 + (y1 - y2) ** 2 < 100 n = int(input()) info = [list(map(int, input().split())) for i in range(n)] MAX_LEN = 500 is_seated = [[-1] * MAX_LEN for _ in range(MAX_LEN)] for i in range(n): x, y = info[i] x -= 1 y -= 1 is_seated[x][y] = i dp = [[0] * MAX_LEN for i in range(MAX_LEN)] ru = [0] * (MAX_LEN + 1) for x in range(MAX_LEN): for y in range(MAX_LEN): if is_seated[x][y] == -1: continue else: dp[x][y] = 1 dp[x][y] = max(ru[max(x + 1 - 10, 0)] + 1, dp[x][y]) for x2 in range(max(x - 10, 0), x): for y2 in range(MAX_LEN): if in_10(x, y, x2, y2): continue dp[x][y] = max(dp[x2][y2] + 1, dp[x][y]) for y2 in range(y): if in_10(x, y, x, y2): continue dp[x][y] = max(dp[x][y2] + 1, dp[x][y]) tmp_max = 0 for y in range(MAX_LEN): tmp_max = max(dp[x][y], tmp_max) ru[x + 1] = max(ru[x], tmp_max) # 復元する max_ = 0 ans = [] for x in range(MAX_LEN)[::-1]: for y in range(MAX_LEN)[::-1]: if max_ == 0 and dp[x][y] > 0: ans.append(is_seated[x][y] + 1) max_ = dp[x][y] elif max_ - 1 == dp[x][y] and dp[x][y] != 0: ans.append(is_seated[x][y] + 1) max_ = dp[x][y] print(len(ans)) print(*ans)