N, M = map(int, input().split())
man = [[int(x) for x in input().split()] for _ in range(N)]
check = [[int(x) for x in input().split()] for _ in range(M)]

for a, b in man:
    tmp = 1000000000
    ans = 1
    for i, (c, d) in enumerate(check):
        if tmp > (abs(a-c) + abs(b-d)):
            tmp = min(tmp, abs(a-c) + abs(b-d))
    print(ans)