def get_stage(position, lst):
    """Return the first index such that cumsum(<=i) >= position."""
    i = 0
    summed = 0
    total = sum(lst)
    position = position % total
    for value in lst:
        if summed + value > position:
            return i
        else:
            summed = summed + value
            i = i + 1
    return len(lst) - 1