n,m=map(int,input().split())
A=[]
B=[]
for i in range(n):
  A.append(list(map(int,input().split())))
for i in range(m):
  B.append(list(map(int,input().split())))

for i in range(n):
  man=1000000000
  ans=0
  for j in range(m):
    if abs(A[i][0]-B[j][0])+abs(A[i][1]-B[j][1])<man:
      man=abs(A[i][0]-B[j][0])+abs(A[i][1]-B[j][1])
      ans=j
  print(ans)