N,M=map(int,input().split())
stand=[list(map(int,input().split())) for _ in range(N)]
point=[list(map(int,input().split())) for _ in range(M)]
new_stand=[None]*N

for i in range(N):
    nearest=float("inf")
    near_ind=M
    for j in range(N):
        man=abs(point[j][0]-stand[i][0]) + abs(point[j][1]-stand[i][1])
        if nearest>man:
            nearest=man
            near_ind=j
        if nearest==man and near_ind>j:
            near_ind=j           
            
            
    new_stand[i]=near_ind+1

for i in range(N):
    print(new_stand[i])
    