#abc064 b
n,m=map(int,input().split())
student=[]
checkpoint=[]
for i in range(n):
    x=list(map(int,input().split()))
    student.append(x)
for i in range(m):
    x=list(map(int,input().split()))
    checkpoint.append(x)

for p in student:
    distance=100100100
    i=1
    ans=0
    for c in checkpoint:
        d=abs(p[0]-c[0])+abs(p[1]-c[1])
        if distance>d:
            distance=d
            ans=i
        i+=1
    print(ans)
