n, m = map(int, input().split())
a = []
c = []
for i in range(n):
    a.append(list(map(int, input().split())))
for i in range(m):
    c.append(list(map(int, input().split())))

for i, j in a:
    n = 1
    n_min = 0
    d = 10**8 + 1
    for k, l in c:
        if d > abs(i-k) + abs(j-l):
            d = abs(i-k) + abs(j-l)
            n_min = n
        n += 1
    print(n_min)
