# N人
# M個のチェックポイント
N, M = map(int, input().split())

student = []
for _ in range(N):
    student.append(list(map(int, input().split())))
    
cp = []
for _ in range(M):
    cp.append(list(map(int, input().split())))
    
goal = [10000000 for _ in range(N)]
ans = [0 for _ in range(N)]
for n in range(N):
    for m in range(M):
        x = abs(student[n][0] - cp[m][0])
        y = abs(student[n][1] - cp[m][1])
        #print(student[n], cp[m])
        #print("abs(x-y)", x, y, x+y)
        if goal[n] > x+y:
            goal[n] = x+y
            ans[n] = m +1
            #print(goal[n], ans[n])


for n in range(N):
    print(ans[n])