def manhattan(u, v):
  return abs(u[0]-v[0])+abs(u[1]-v[1])

N, M = map(int, input().split())
ns = [list(map(int, input().split())) for _ in range(N)]
ms = [list(map(int, input().split())) for _ in range(M)]

for n in ns:
  dmin = 200000005
  num = -1
  for i, m in enumerate(ms):
    d = manhattan(n, m)
    if d < dmin:
      dmin = d
      num = i
  print(num+1)