# B - Checkpoints
N, M = list(map(int, input().split()))
P = [list(map(int, input().split())) for i in range(N)]
C = [list(map(int, input().split())) for i in range(M)]

ans = [1]*N
for i in range(N): # i番目の人
    D = [10 ** 9] * M
    for j in range(M): # jのチェックポイント
        D[j]= abs(P[i][0]-C[j][0]) + abs(P[i][1]-C[j][1])
        if D[j] < D[j-1]:
            ans[i] = j+1
        else:
            pass

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