n,m = map(int,input().split())
stds = [tuple(map(int,input().split())) for _ in range(n)]
points = [tuple(map(int,input().split())) for _ in range(m)]

def d(s,p):
  return abs(s[0]-p[0]) + abs(s[1] + p[1])

for std in stds:
  ans = (float('inf'), -1)
  for i, pnt in enumerate(points):
    if d(std,pnt) < ans[1]:
      ans = (i, pnt)
  print(i+1)