n,m=map(int,raw_input().split())
st=[]
ch=[]
l=[]
for i in range(n):
    g=map(int,raw_input().split())
    st.append(g)
for y in range(n):
    r=map(int,raw_input().split())
    ch.append(r)





def dis(a,b):
    return abs(a[0]-b[0])+abs(a[1]-b[1])

for stu in st:
    ctr=0
    gh=10**9+7
    new={}
    for che in ch:
        # print stu,che,dis(stu,che)
        if dis(stu,che)<gh:
            gh=dis(stu,che)
            ctr+=1
            if gh not in new:
                new[gh]=[ctr]
            else:
                new[gh].append(ctr)


        else:
            ctr+=1
    # print new
    po=new.keys()
    # print po
    po.sort()
    poi=new[po[0]]
    # print poi
    poi.sort()
    l.append(poi[0])
for numb in l:
    print numb
