n,m = map(int,input().split())
a = [list(map(int,input().split())) for i in range(n)]
b = [list(map(int,input().split())) for i in range(n)]

ans = []

for i in a:
  count = 10**10
  check = 0
  for j in range(m):
    if count > abs(i[0]-b[j][0])+abs(i[1]-b[j][1]):
      check = j+1
      count = abs(i[0]-b[j][0])+abs(i[1]-b[j][1])
    
  ans.append(check)
for i in ans:
  print(i)