n,m=map(int,raw_input().split())
stu=[]
point=[]


for i in xrange(n):
    stu.append(map(int,raw_input().split()))
for j in xrange(m):
    point.append(map(int,raw_input().split()))


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



for co in stu:
    ctr=1
    l=[]
    for po in point:
        l.append((dis(po,co),ctr))
        ctr+=1
    l.sort()
    print l[0][1]