def determine_turn(iteration: int, sequencing: list):
    """
    Determines turn for a given sequencing based on current iteration
    Assumes that iterations starts with 0
    Useful for turn-based training (for example, GANs)
    """
    iteration = iteration % sum(sequencing)
    for i in range(len(sequencing)):
        if sum(sequencing[:i]) <= iteration < sum(sequencing[:i + 1]):
            return i
    assert False, 'Impossible scenario in determine_turn'
