N, M = map(int, input().split())

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])
print(A)
for i in range(M):
    c, d = map(int, input().split())
    saitei = float("inf")
    for j in range(N):
        if abs(A[j][0]-c) + abs(A[j][1]-d) < saitei:
            saitei = abs(A[i][0]-c) + abs(A[i][1]-d)
            ans = j+1   
        else:
            continue
    print(ans) 