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

# 2次元配列
student = []
for i in range(n):
    array = list(map(int, input().strip().split()))
    student.append(array)

cp = []
for i in range(m):
    array = list(map(int, input().strip().split()))
    cp.append(array)

result = [0] * n
for i in range(n):
  dis_min = 10**9
  for j in range(m):
    dis = abs(student[i][0]-cp[j][0]) + abs(student[i][1] - cp[j][1])
    if dis <= dis_min:
      dis_min = dis
      result[i] = j+1

for i in result:
  print(i)