N, M = map(int, input().split())
student_pos = [[int(i) for i in input().split()]for _ in range(N)]
check_pos = [[int(i) for i in input().split()]for _ in range(N)]

manhattan_distance = lambda x1, y1, x2, y2:abs(x1 - x2) + abs(y1 - y2)

for spos in student_pos:
   distances =  [manhattan_distance(spos[0], spos[1], chpos[0],chpos[1]) for chpos in check_pos]
   print(distances.index(min(distances)) + 1)
