N,M = map(int,input().split())
A = []
B = []
C = []
D = []
for i in range(N):
    x,y = map(int,input().split())
    A.append(x)
    B.append(y)
for i in range(M):
    x,y = map(int,input().split())
    C.append(x)
    D.append(y)
k = 0
for i in range(N):
    g = 51
    for j in range(M):
        t = abs(A[i]-C[j])+abs(B[i]-D[j])
        
        if t < g:
            k = j+1
            g = t
    print(k)