poop=input().split()
kpop=int(poop[0])
jpop=int(poop[1])
lop=[]
jop=[]
for i in range(kpop):
    lop.append(input().split())
for i in range(jpop):
    jop.append(input().split())
for i in range(kpop):
    k=999999999999999
    z=0
    for j in range(jpop):
        l=lop[i][0]
        m=jop[j][0]
        n=lop[i][1]
        o=jop[j][1]
        if k>abs(int(l)-int(m))+abs(int(n)-int(o)):
            z=j
            k=abs(int(l)-int(m))+abs(int(n)-int(o))
    print(z)