n,m = map(int, input().split())
students = [list(map(int, input().split())) for _ in range(n)]
chkpoints = [list(map(int, input().split())) for _ in range(m)]
dist = 0
ans = 0
for student in students:
  min_dist = 100000000
  for i in range(m):
    dist = abs(student[0]-chkpoints[i][0])+abs(student[1]-chkpoints[i][1])
    if dist < min_dist:
      min_dist = dist
      ans = i+1
  print(ans)