N,M=map(int,raw_input().split())
A=[map(int,raw_input().split()) for i in range(N)]
C=[map(int,raw_input().split()) for i in range(M)]

ans=[]
l= float("inf")
for a,b in A:
	l= float("inf")
	for i,c in enumerate(C):
		if l>abs(a-c[0])+abs(b-c[1]):
			l=abs(a-c[0])+abs(b-c[1])
			x=i+1
	else:
		ans.append(x)

for i in ans:
	print i