





'''simple docstring'''




from __future__ import annotations






def 	_lowerCAmelCase      (  __snake_case  :			list[int]			,							__snake_case  :			int      )					->					list[list[int]]:
     __A						:			list[list[int]]								=	[]
     __A						:			list[int]								=	[]
     __A						:			Tuple								=	0
     __A						:			Optional[Any]								=	sum(__snake_case      )
     create_state_space_tree(__snake_case			,							__snake_case			,							__snake_case			,							__snake_case			,							__snake_case			,							__snake_case      )
     return result






def 	_lowerCAmelCase      (  __snake_case  :			list[int]			,							__snake_case  :			int			,							__snake_case  :			int			,							__snake_case  :			list[int]			,							__snake_case  :			list[list[int]]			,							__snake_case  :			int			,							)					->					None:
     if sum(__snake_case      ) > max_sum or (remaining_nums_sum + sum(__snake_case      )) < max_sum:
          return
     if sum(__snake_case      ) == max_sum:
          result.append(__snake_case      )
          return
     for index in range(__snake_case			,							len(__snake_case      )      ):
          create_state_space_tree(
              __snake_case			,							__snake_case			,							index + 1			,							[*path, nums[index]]			,							__snake_case			,							remaining_nums_sum - nums[index]			,							)
lowercase__   :				Union[str, Any]      =   [3, 34, 4, 12, 5, 2]
lowercase__   :				Optional[int]      =   9
lowercase__   :				Tuple      =   generate_sum_of_subsets_soln(nums, max_sum)







print(*result)






'''simple docstring'''




from __future__ import annotations






def 	_lowerCAmelCase      (  __snake_case  :			list[int | str]      )					->					None:
     create_state_space_tree(__snake_case			,							[]			,							0			,							[0 for i in range(len(__snake_case      )      )]      )






def 	_lowerCAmelCase      (  __snake_case  :			list[int | str]			,							__snake_case  :			list[int | str]			,							__snake_case  :			int			,							__snake_case  :			list[int]			,							)					->					None:

     if index == len(__snake_case      ):
          print(__snake_case      )
          return

     for i in range(len(__snake_case      )      ):
          if not index_used[i]:
               current_sequence.append(sequence[i]      )
               __A						:			Any								=	True
               create_state_space_tree(__snake_case			,							__snake_case			,							index + 1			,							__snake_case      )
               current_sequence.pop()
               __A						:			Any								=	False
lowercase__   :				list[int | str]      =   [3, 1, 2, 4]
generate_all_permutations(sequence)

lowercase__   :				list[int | str]      =   ["A", "B", "C"]







generate_all_permutations(sequence_a)