N, M = [int(x) for x in input().split()]

P = []
C = []


for i in range(N):
    P += [[int(x) for x in input().split()]]
    
for i in range(M):
    C += [[int(x) for x in input().split()]]

for i in range(N):
    d_min = abs(P[0][0] - C[0][0]) + abs(P[0][1] - C[0][1])
    c_min = 1
    for j in range(M):
        d = abs(P[i][0] - C[j][0]) + abs(P[i][1] - C[j][1])
        if d < d_min:
            d_min = d
            c_min = j+1
    print(c_min)