N,M = map(int,input().split(" "))
students = [tuple(map(int,input().split(" "))) for _ in range(N)]
checkpoints = [tuple(map(int,input().split(" "))) for _ in range(M)]
Ans = [(0,100)]*N

# print(students)
# print(checkpoints)

i = 0
for n in students:
    j=1
    for m in checkpoints:
        dist = abs(n[0]-m[0])+abs(n[1]-m[1])
        if dist<Ans[i][1]:
            Ans[i] = (j,dist)
        j+=1
        
    i+=1
    
# print(Ans)

for ans in Ans:
    print(ans[0])