n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(m)]
ans = [0]*n

for i in range(1, n+1):
    check = 50
    point = 0
    for j in range(1, m+1):
        num = abs(ab[i-1][0]-cd[j-1][0]) + abs(ab[i-1][1]-cd[j-1][1])
        if check > num:
            check = num
            point = j
    ans[i-1] += point

print(*ans, sep='\n')