n=int(input()) b=[500*[0]for _ in range(500)] xy=[list(map(lambda x:int(x)-1,input().split()))for _ in range(n)] for i in range(n): x,y=xy[i] xy[i]=((x**2+y**2)**0.5,x,y,i) xy.sort() ans=[] dxx=[1,0,-1,0] dyy=[0,1,0,-1] dxy=zip(dxx,dyy) for _,sx,sy,i in xy: if b[sx][sy]:continue ans.append(i+1) stack=[(sx,sy)] for x,y in stack: b[x][y]=1 for dx,dy in zip(dxx,dyy): if ((sx-(x+dx))**2+(sy-(y+dy))**2)**0.5>10:continue if not(0<=x+dx<500):continue if not(0<=y+dy<500):continue if b[x+dx][y+dy]:continue stack.append((x+dx,y+dy)) print(len(ans)) print(*ans)