'''simple docstring'''

from __future__ import annotations



def snake_case_      (					__snake_case  :							dict	,   __snake_case  :							str)			->					set[str]:
   lowerCAmelCase_	,lowerCAmelCase_			=      set(__snake_case), [start]

   while stack:
      lowerCAmelCase_			=      stack.pop()
      explored.add(__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(__snake_case)
   return explored


A_     :						Optional[int]    							={
    '''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'''))






'''simple docstring'''

from __future__ import annotations

from typing import Any



def snake_case_      (					__snake_case  :							list[Any])			->					None:
   create_state_space_tree(__snake_case	,   []	,   0)



def snake_case_      (					__snake_case  :							list[Any]	,   __snake_case  :							list[Any]	,   __snake_case  :							int)			->					None:

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

   create_state_space_tree(__snake_case	,   __snake_case	,   index + 1)
   current_subsequence.append(sequence[index])
   create_state_space_tree(__snake_case	,   __snake_case	,   index + 1)
   current_subsequence.pop()


if __name__ == "__main__":
 A_     :						list[Any]    							=[3, 1, 2, 4]
 generate_all_subsequences(seq)

 seq.clear()
 seq.extend(['''A''', '''B''', '''C'''])
 generate_all_subsequences(seq)





