n, m = map(int, input().split()) 
ab = []
for i in range(n):
  a, b = map(int, input().split()) 
  ab.append([a,b])

cd = []  
for i in range(n):
  c, d = map(int, input().split()) 
  cd.append([c,d])

distance = []
for a, b in ab:
  for c, d in cd:
    distance.append(abs(a-c)+abs(b-d))
  print(distance.index(min(distance))+1)
  distance.clear()