a,b = map(int,input().split())
S = [list(map(int,input().split())) for i in range(a)]
CP = [list(map(int,input().split())) for i in range(b)]
for s in S:
  count = 0
  ab = 10**8
  p = 10**8
  for cp in CP:
    total = abs(s[0]-cp[0]) + abs(s[1]-cp[1])
    count +=1
    if ab > total:
      ab = total
      p = count
      
  print(p)