n, m = map(int, input().split())

N_ab = []
M_cd = []

for i in range(n):
  a, b = map(int, input().split())
  N_ab.append([a, b])
  
for i in range(n):
  c, d = map(int, input().split())
  M_cd.append([c, d])
  
for i in range(n):
  Mi = abs(N_ab[i][0]-M_cd[0][0]) + abs(N_ab[i][1]-M_cd[0][1])
  #print(Mi)
  num = 0
  for j in range(1, m):
    tmp = abs(N_ab[i][0]-M_cd[j][0]) + abs(N_ab[i][1]-M_cd[j][1])
    #print(tmp)
    if tmp<Mi:
      Mi=tmp
      num=j
  print(num+1)