N, M = map(int, input().split())
AB = []
for _ in range(N):
  a, b = map(int, input().split())
  AB.append((a, b))

CD = []
for _ in range(M):
  c, d = map(int, input().split())
  CD.append((c, d))

check_index = []
for i, ab in enumerate(AB):
  min_index = 0
  for j, cd in enumerate(CD):
    check_dis = distance(ab, cd)
    min_dis = distance(ab, CD[min_index])
    if(min_dis > check_dis):
      min_index = j
  
  check_index.append(min_index)

for ci in check_index:
  print(ci + 1)
