N,M=map(int,input().split())
ab=[[int(i) for i in input().split()] for i in range(N)]
check=[[int(i) for  i in input().split()] for i in range(M)]
for hito in ab:
    curmin=10**8
    goto=0
    for j in range(M):
        dist=abs(check[j][1]-hito[1])+abs(check[j][0]-hito[0])
        if dist<curmin:
            curmin=dist
            goto=j+1
    print(goto)
        