N, M = map(int, input().split())
stu_li = [list(map(int, input().split())) for i in range(N)]
chk_li = [list(map(int, input().split())) for i in range(M)]

import math
min_dist = math.inf
min_num = M
for i in range(N) :
    for j in range(M) :
        dist = abs(stu_li[i][0] - chk_li[j][0]) + abs(stu_li[i][1] - chk_li[j][1])
        if dist < min_dist : 
            min_dist = dist
            min_num = j
    print(min_num + 1)
    min_dist = math.inf
    min_num = M
