N, M = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N)]
c = []
d = []
for _ in range(M):
    C, D = map(int, input().split())
    c.append(C)
    d.append(D)


I = []
for a, b in ab:
    n = 10 ** 8
    I_n = ""
    for i in range(M):
        if abs(a-c[i]) + abs(b-d[i]) < n:
            if not i in I:
                n = abs(a-c[i]) + abs(b-d[i])
                I_n = i
    print(I_n + 1)
    I.append(I_n)