import numpy as np

N, M = map(int, input().split())
A = [map(int, input().split()) for _ in range(N)]
B = [map(int, input().split()) for _ in range(M)]

for (x, y) in A:
    d = np.array([])
    for q in B:
        print("q = ", q)
        print("*q=", *q,)
        a, b = q
        d = np.append(d, abs(x-a) + abs(y-b))
    print(np.argmin(d) + 1)