N, M = map(int, input().split())
students = [list(map(int, input().split())) for _ in range(N)]
checkpoints = [list(map(int, input().split())) for _ in range(M)]

for student in students:
    nearst_index = 0
    _min = 10**8
    for point_index in range(len(checkpoints)):
        diff = abs(student[0] - checkpoints[point_index][0])+abs(student[1] - checkpoints[point_index][1])
        if diff < _min:
            _min = diff
            nearst_index = point_index+1
    print(nearst_index)