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])

d = {}
for i in range(len(ab)):
  for j in range(len(cd)):
    d[j+1] = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])
  print(min(d, key=d.get))