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 j in range(M) :
    c,d = map(int,input().split())
    C.append(c)
    D.append(d)
for k in range(N) :
    distance = 10**8
    answer = -1
    for l in range(M) :
        p = abs(A[k]-C[l])
        q = abs(B[k]-D[l])
        d = p+q
        if d < distance :
            distance = d
            answer = l+1
    print(answer)


    