N,M = map(int,input().split())
li=[]
check=[]
for i in range(N):
  li.append(list(map(int,input().split())))
for i in range(M):
  check.append(list(map(int,input().split())))

for i in range(N):
  min=100
  minindex=0
  for j in range(M):
    dis=abs(li[i][0]-check[j][0])+abs(li[i][1]-check[j][1])
    if dis<min:
      min=dis
      minindex=j
  print(minindex+1)