n, m = map(int, input().split())
ab = [list(map(int, input().split(" "))) for i in range(n)]
cd = [list(map(int, input().split(" "))) for i in range(m)]

min_distance_point = [None for i in range(m)]
for i, ab_i in enumerate(ab):
    a_i, b_i = ab_i
    min_distance_num = 10000
    min_distance = 100000000000
    for j, cd_i in enumerate(cd):
        c_i, d_i = cd_i
        distance = abs(a_i - c_i) + abs(b_i - d_i)
        if distance < min_distance:
            min_distance = distance
            min_distance_num = j+1
    min_distance_point[i] = min_distance_num
[print(x) for x in min_distance_point]