n, m = map(int, input().split())
students =[]
points = []
maximum = 10**8
check = 0
for i in range(n):
  students.append(list(map(int, input().split())))

for i in range(m):
  points.append(list(map(int, input().split())))

for i in students:
  temp = maximum
  for index, j in enumerate(points):
    if abs(i[0] - j[0]) + abs(i[1] - j[1]) < temp:
      temp = abs(i[0] - j[0]) + abs(i[1] - j[1])
      check = index + 1
  print(check)