from random import randint inf=998244353 def calc(a,b): return ((star[a][0]-star[b][0])**2+(star[a][1]-star[b][1])**2)*star[a][2]*star[b][2] def sell(strict): pos=0 go={0} ans=[0] ansdis=0 while len(go)imp: l=i r=j imp=pre if l==-1: break for i in range((r-l+1)//2): ans[l+i],ans[r-i]=ans[r-i],ans[l+i] return ansdis,ans N,M=map(int,input().split()) star=[tuple(map(int,input().split()+["5"])) for i in range(N)]+[[0,0,1] for i in range(M)] gr=[[0,0,0]for i in range(M-1)] for i in range(N): pos=randint(0,M-2) gr[pos][0]+=star[i][0] gr[pos][1]+=star[i][1] gr[pos][2]+=1 for i in range(M-1): star[N+i][0]=gr[i][0]//gr[i][2] star[N+i][1]=gr[i][1]//gr[i][2] for i in range(100): gr=[[0,0,0] for j in range(M-1)] for j in range(N): nea=inf pos=-1 for k in range(M-1): pre=(star[N+k][0]-star[j][0])**2+(star[N+k][1]-star[j][1])**2 if pre=N: print(2,i-N+1) else: print(1,i+1)