


from __future__ import annotations

def 						_UpperCAmelCase				(			SCREAMING_SNAKE_CASE__			:					list[int]			,     SCREAMING_SNAKE_CASE__			:					int				):
     __UpperCamelCase    							=[]
     __UpperCamelCase    							=[]
     __UpperCamelCase    							=0
     __UpperCamelCase    							=sum(SCREAMING_SNAKE_CASE__				)
     create_state_space_tree(SCREAMING_SNAKE_CASE__			,     SCREAMING_SNAKE_CASE__			,     SCREAMING_SNAKE_CASE__			,     SCREAMING_SNAKE_CASE__			,     SCREAMING_SNAKE_CASE__			,     SCREAMING_SNAKE_CASE__				)
     return result

def 						_UpperCAmelCase				(			SCREAMING_SNAKE_CASE__			:					list[int]			,     SCREAMING_SNAKE_CASE__			:					int			,     SCREAMING_SNAKE_CASE__			:					int			,     SCREAMING_SNAKE_CASE__			:					list[int]			,     SCREAMING_SNAKE_CASE__			:					list[list[int]]			,     SCREAMING_SNAKE_CASE__			:					int			,     ):
     if sum(SCREAMING_SNAKE_CASE__				) > max_sum or (remaining_nums_sum + sum(SCREAMING_SNAKE_CASE__				)) < max_sum:
          return
     if sum(SCREAMING_SNAKE_CASE__				) == max_sum:
          result.append(SCREAMING_SNAKE_CASE__				)
          return
     for index in range(SCREAMING_SNAKE_CASE__			,     len(SCREAMING_SNAKE_CASE__				)				):
          create_state_space_tree(
              SCREAMING_SNAKE_CASE__			,     SCREAMING_SNAKE_CASE__			,     index + 1			,     [*path, nums[index]]			,     SCREAMING_SNAKE_CASE__			,     remaining_nums_sum - nums[index]			,     )
_A		       =						[3, 34, 4, 12, 5, 2]
_A		       =						9
_A		       =						generate_sum_of_subsets_soln(nums, max_sum)





print(*result)








from __future__ import annotations

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    dict	,     SCREAMING_SNAKE_CASE_		:    str			):



     '''simple docstring'''





     lowercase__      , lowercase__    :   List[str]      =       set(SCREAMING_SNAKE_CASE_			), [start]

     while stack:
          lowercase__    :   Union[str, Any]      =       stack.pop()
          explored.add(SCREAMING_SNAKE_CASE_			)
          # Differences from BFS:
          # 1) pop last element instead of first one
          # 2) add adjacent elements to stack without exploring them
          for adj in reversed(graph[v]			):
               if adj not in explored:
                    stack.append(SCREAMING_SNAKE_CASE_			)
     return explored


snake_case_			  = {
    '''A''': ['''B''', '''C''', '''D'''],
    '''B''': ['''A''', '''D''', '''E'''],
    '''C''': ['''A''', '''F'''],
    '''D''': ['''B''', '''D'''],
    '''E''': ['''B''', '''F'''],
    '''F''': ['''C''', '''E''', '''G'''],
    '''G''': ['''F'''],
}

if __name__ == "__main__":
       import doctest

       doctest.testmod()
       print(depth_first_search(G, '''A'''))

