N, M = map(int, raw_input().split())
a = [0]*N
b = [0]*N
for i in range(N):
  a[i], b[i] = map(int, raw_input().split())
c = [0]*M
d = [0]*M
for j in range(M):
  c[j], d[j] = map(int, raw_input().split())
for i in range(N):
  mj = 0
  md = abs(a[i]-c[0])+abs(b[i]-d[0])
  for j in range(1, M):
    dj = abs(a[i]-c[j])+abs(b[i]-d[j])
    if dj < md:
      mj = j
      md = dj
  print mj+1