n,m=[int(i) for i in input().split()]
ab=[]
cd=[]
for i in range(n):
    a,b=[int(j) for j in input().split()]
    ab.append((a,b))

for i in range(m):
    c,d=[int(j) for j in input().split()]
    cd.append((c,d))

for i in range(n):
    mini=10000000
    for j in range(m):
        dis=abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])
        if mini>dis:
            mini=dis
            point=j+1
    print(point)