n, m = map(int, input().split())
pos = []
check = []
for i in range(n):
  pos.append(list(map(int, input().split())))

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

for i in pos:
  closest = [10**8, 0]
  for j, v in enumerate(check):
    if abs(i[0] - v[0]) + abs(i[1] - v[1]) < closest[0]:
      closest[0], closest[1] = abs(i[0] - v[0]) + abs(i[1] - v[1]), j + 1
  print(closest[1])
