N, M = map(int, input().split())
a, b, c, d = [],[],[],[]

for i in range(N):
  ai, bi = map(int, input().split())
  a.append(ai)
  b.append(bi)
#  print(a, b)
for j in range(M):
  cj, dj = map(int, input().split())
  c.append(cj)
  d.append(dj)
  
#print(a,b,c,d)
  
for i in range(N):
  dist, min_dist = 0, 10**8+1
  ans = 1
  for j in range(M):
    dist = abs(c[j] - a[i]) + abs(d[j] - b[i])
    if dist < min_dist:
      ans = j+1
      min_dist = dist
#    print("ai:{}, bi:{}, cj:{}, dj:{}, dist:{}, ans:{}".format(a[i], b[i], c[j], d[j], dist, ans))
#    print("i:{}, j:{}, dist:{}, min_dist:{}, ans:{}".format(i, j, dist, min_dist, ans))
#    min_dist = min(dist, min_dist)
  print(ans)