N, M = map(int, input().split())
ab = []
cd = []
for _ in range(N):
    a, b = map(int, input().split())
    ab.append([a, b])
for _ in range(N):
    c, d = map(int, input().split())
    cd.append([c, d])

for a, b in ab:
    near = 10**16
    for i, n in enumerate(cd):
        tmp = abs(a-n[0])+abs(b-n[1])
        if near == tmp:
            continue
        near = min(near, tmp)
        if near == tmp:
            ans = i + 1
    print(ans)