N, M = map(int, input().split())

st = []
for n in range(N):
  st.append(list(map(int, input().split())))

cs = []
for m in range(M):
  cs.append(list(map(int, input().split())))
  
for n in range(N):
  min_d = 100000
  min_i = -1
  for m in range(M):
    d = abs(st[n][0]-cs[m][0]) + abs(st[n][1]-cs[m][1])
    if d < min_d:
      min_d = d
      min_i = m
  print(min_i+1)