n,m=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(n)]
cd=[list(map(int,input().split())) for i in range(m)]
ans=[50]*n
for i in range(n):
    tmp=50
    for j in range(m):
        ck=abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])
        if tmp>ck:
            tmp=ck
            ans[i]=j+1
print(*ans,sep='\n')
