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

for a,b in S:
    distance = 10**10
    ans = 0
    for c,d in C:
        #print(abs(a - c) + abs(b - d))
        if abs(a - c) + abs(b - d) < distance:
            distance = abs(a - c) + abs(b - d)
            ans += 1
    print(ans)


