n,m=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(n)]
cd=[list(map(int,input().split())) for _ in range(m)]
for i in ab:
	e=10**8
	f=0
	for p,j in enumerate(cd):
		g=abs(i[0]-j[0])+abs(i[1]-j[1])
		if e>g:
			e,f=g,p
	print(f+1)