print(1)
    @task
    def work_task():
        print(1)
    @task
    def setup_task():
        print(1)
    def make_task(task_id, dag):
        """
        Task factory helper.
        Will give a setup, teardown, work, or teardown-with-dagrun-failure task depending on input.
        """
        if task_id.startswith("s"):
            factory = setup_task
        elif task_id.startswith("w"):
            factory = work_task
        elif task_id.endswith("_"):
            factory = teardown_task.override(on_failure_fail_dagrun=True)
        else:
            factory = teardown_task
        return dag.task_dict.get(task_id) or factory.override(task_id=task_id)()
    with dag_maker() as dag:
        for line in input:
            tasks = [make_task(x, dag) for x in line.split(" >> ")]
            reduce(lambda x, y: x >> y, tasks)
    dr = dag_maker.create_dagrun()
    tis = dr.task_instance_scheduling_decisions(session).tis
    tis_for_state = {x.task_id for x in dr._tis_for_dagrun_state(dag=dag, tis=tis)}
    assert tis_for_state == expected