N,M=map(int,input().split())
AB=[list(map(int,input().split())) for i in range(N)]
CD=[list(map(int,input().split())) for j in range(M)]
for i in range(N):
    d=(10**8)*2
    ans=0
    for j in range(M):
        if abs(AB[i][0]-CD[j][0])+abs(AB[i][1]-CD[j][1])<d:
            d=abs(AB[i][0]-CD[j][0])+abs(AB[i][1]-CD[j][1])
            ans=j+1
    print(ans)