N, M = list(map(int, input().split()))
St = [input().split() for _ in range(N)]
Ch = [input().split() for _ in range(M)]

print(St)
for i in range(N):
    memo = []
    for j in range(M):
        diff = abs(int(St[i][0]) - int(Ch[j][0])) + abs(int(St[i][1]) - int(Ch[j][1]))
        memo.append(diff)
    print(memo.index(min(memo)) + 1)
