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)] star[N]=[star[0][0],star[0][1],1] for i in range(M-1): nea=0 pos=-1 for j in range(N): for k in range(i+1): pre=(star[N+k][0]-star[j][0])**2+(star[N+k][1]-star[j][1])**2 if pre>nea: nea=pre pos=j star[N+i+1]=[star[pos][0],star[pos][1],1] while True: gr=[[0,0,0] for j in range(M)] for j in range(N): nea=inf pos=-1 for k in range(M): 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)