def dis(XY1, XY2):
    return abs(XY1[0]-XY2[0]) + abs(XY1[1]-XY2[1])

N, M = map(int,input().split())
AB = [0 for _ in range(N)]
CD = [0 for _ in range(M)]
for i in range(N):
    a,b = map(int,input().split())
    AB[i] = [a,b]
for i in range(M):
    c,d = map(int,input().split())
    CD[i] = [c,d]

for ab in AB:
    mini = 2*(10**8)
    id = 0
    for cd in CD:
        if mini > dis(ab,cd):
            mini = dis(ab,cd)
            id = CD.index(cd)+1
    print(id)