def get_min_distance_index(spos, check_pos):
    manhattan_distance = lambda x1, y1, x2, y2:abs(x1 - x2) + abs(y1 - y2)
    minimum = -1
    min_index = 0 

    for index, chpos in enumerate(check_pos):
        manhattan = manhattan_distance(spos[0], spos[1], chpos[0], chpos[1])
        if minimum < 0 or manhattan < minimum:
            minimum = manhattan
            min_index = index + 1

    return min_index


N, M = map(int, input().split())
student_pos = [[int(i) for i in input().split()]for _ in range(N)]
check_pos = [[int(i) for i in input().split()]for _ in range(N)]

for spos in student_pos:
    print(get_min_distance_index(spos, check_pos))
