n,m=map(int,input().split())
A,B,C,D=[],[],[],[]
for i in range(n):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)
for i in range(m):
    c,d=map(int,input().split())
    C.append(c)
    D.append(d)
for i in range(n):
    ans,x=100000000,0
    for j in range(m):
        if ans>abs(A[i]-C[j])+abs(B[i]-D[j]):
            ans=abs(A[i]-C[j])+abs(B[i]-D[j])
            x=j
    print(x+1)


