N,M=map(int,input().split())
A=[list(map(int,input().split())) for i in range(N)]
C=[list(map(int,input().split())) for i in range(M)]
for i in range(N):
    z=10**10
    ans=0
    for t in range(M):
        if abs(A[i][0]-C[t][0])+abs(A[i][0]-C[t][1])<z:
            z=abs(A[i][0]-C[t][0])+abs(A[i][0]-C[t][1])
            ans=t+1
        else:
            continue
    print(ans)