N,M = map(int,input().split())
ab = [[int(x) for x in input().split()]for i in range(N)]
for i in range(M):
  c,d = map(int,input().split())
  ans = [10**9,-1]
  for j in range(N):
    if ans[0] > abs(ab[j][0]-c)+abs(ab[j][1]-d):
      ans = [abs(ab[j][0]-c)+abs(ab[j][1]-d),j+1]
  print(ans[1])