






__a      :       Optional[Any]				  =   {0: [2, 3], 1: [0], 2: [1], 3: [4], 4: []}

__a      :       Tuple				  =   {0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]}



def 			_SCREAMING_SNAKE_CASE						( __lowercase   :			dict[int, list[int]]			,				__lowercase   :			int			,				__lowercase   :			list[bool]    )						->      list[int]:





    """simple docstring"""

    __A         =	True
    __A         =	[]

    for neighbour in graph[vert]:
        if not visited[neighbour]:
            order += topology_sort(SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_    )

    order.append(SCREAMING_SNAKE_CASE_    )

    return order



def 			_SCREAMING_SNAKE_CASE						( __lowercase   :			dict[int, list[int]]			,				__lowercase   :			int			,				__lowercase   :			list[bool]    )						->      list[int]:





    """simple docstring"""

    __A         =	True
    __A         =	[vert]

    for neighbour in reversed_graph[vert]:
        if not visited[neighbour]:
            component += find_components(SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_    )

    return component






def 			_SCREAMING_SNAKE_CASE						( __lowercase   :			dict[int, list[int]]    )						->      list[list[int]]:





    """simple docstring"""

    __A         =	len(SCREAMING_SNAKE_CASE_    ) * [False]
    __A         =	{vert: [] for vert in range(len(SCREAMING_SNAKE_CASE_    )    )}

    for vert, neighbours in graph.items():
        for neighbour in neighbours:
            reversed_graph[neighbour].append(SCREAMING_SNAKE_CASE_    )

    __A         =	[]
    for i, was_visited in enumerate(SCREAMING_SNAKE_CASE_    ):
        if not was_visited:
            order += topology_sort(SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_    )

    __A         =	[]
    __A         =	len(SCREAMING_SNAKE_CASE_    ) * [False]

    for i in range(len(SCREAMING_SNAKE_CASE_    )    ):
        __A         =	order[len(SCREAMING_SNAKE_CASE_    ) - i - 1]
        if not visited[vert]:
            __A         =	find_components(SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_    )
            components_list.append(SCREAMING_SNAKE_CASE_    )

    return components_list












from __future__ import annotations



def 			_SCREAMING_SNAKE_CASE						( __lowercase   :			list[int]			,				__lowercase   :			int    )						->      list[list[int]]:





    """simple docstring"""

    __A         =	[]
    __A         =	[]
    __A         =	0
    __A         =	sum(__lowercase    )
    create_state_space_tree(__lowercase			,				__lowercase			,				__lowercase			,				__lowercase			,				__lowercase			,				__lowercase    )
    return result



def 			_SCREAMING_SNAKE_CASE						( __lowercase   :			list[int]			,				__lowercase   :			int			,				__lowercase   :			int			,				__lowercase   :			list[int]			,				__lowercase   :			list[list[int]]			,				__lowercase   :			int			,				)						->      None:





    """simple docstring"""

    if sum(__lowercase    ) > max_sum or (remaining_nums_sum + sum(__lowercase    )) < max_sum:
        return
    if sum(__lowercase    ) == max_sum:
        result.append(__lowercase    )
        return
    for index in range(__lowercase			,				len(__lowercase    )    ):
        create_state_space_tree(
            __lowercase			,				__lowercase			,				index + 1			,				[*path, nums[index]]			,				__lowercase			,				remaining_nums_sum - nums[index]			,				)
__a      :       str				  =   [3, 34, 4, 12, 5, 2]
__a      :       Optional[Any]				  =   9
__a      :       List[str]				  =   generate_sum_of_subsets_soln(nums, max_sum)






print(*result)




