n, m = map(int,input().split())
students = [None]*n
points = [None]*m
for i in range(n):
  students[i] = tuple(map(int,input().split()))
for i in range(m):
  points[i] = tuple(map(int,input().split()))

ans = [None]*n
for s in students:
  tmp = [None]*m
  for p in points:
    tmp[p] = abs(students[s][0] - points[p][0]) + abs(students[s][1] - points[p][1])
  ans[s] = tmp.index(min(tmp))
for i in range(n):
  print(ans[i])
