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)]

if m:
    nums = [None]*n
    for i, ab_i in enumerate(ab):
        min_distance = 100000000
        min_num = 10000
        for j, cd_i in enumerate(cd):
            distance = abs(ab_i[0]-cd_i[0]) + abs(ab_i[1]-cd_i[1])
            if distance < min_distance:
                min_distance = distance
                min_num = j
        nums[i] = min_num+1
    [print(num) for num in nums]
