N, M = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(N)]
cd = [tuple(map(int, input().split())) for _ in range(M)]

for a, b in ab:
    tmp_dist = 10 ** 8 * 2
    tmp_point = 0
    count = 0
    for c, d in cd:
        count += 1
        if tmp_dist > abs(a - c) + abs(b - d):
            tmp_point = count
        tmp_dist = min(tmp_dist, abs(a - c) + abs(b - d))
    else:
        print(tmp_point)