N, M = map(int, input().split())
H = []
for _ in range(N):
    H.append(list(map(int, input().split())))

P = []
for _ in range(M):
    P.append(list(map(int, input().split())))

def check(i):
    min_d = 10 * 9
    x = H[i][0]
    y = H[i][1]
    idx = -1
    for i, p in enumerate(P):
        d = abs(x - p[0]) + abs(y - p[1])
        if d < min_d:
            min_d = d
            idx = i
    return idx

for i in range(N):
    near = check(i)
    print(near + 1)
