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)]

for i in range(n):
    a, b = map(int, input().split())
    ans = abs(a-cd[0][0]) + abs(b-cd[0][1])
    for j in range(m):
        dif = abs(a - cd[j][0]) + abs(b - cd[j][1])
        ans = min(dif, ans)
    print(ans)
