
"""simple docstring"""





import enum
import shutil
import sys


_a       ,       _a		       =							shutil.get_terminal_size()

_a		       =							{'UP': 'A', 'DOWN': 'B', 'RIGHT': 'C', 'LEFT': 'D'}


class A_	(enum.Enum      ):




  '''simple docstring'''
  SCREAMING_SNAKE_CASE__			:						Any       =		0
  SCREAMING_SNAKE_CASE__			:						List[Any]       =		1







def 	__a     (		__lowerCamelCase,		__lowerCamelCase=""  ):
   sys.stdout.write(str(__lowerCamelCase  ) + end  )
   sys.stdout.flush()







def 	__a     (		__lowerCamelCase,		__lowerCamelCase,		__lowerCamelCase=""  ):
   forceWrite(f"""\u001b[{color}m{content}\u001b[0m""",		__lowerCamelCase  )







def 	__a     (		):
   forceWrite("\r"  )







def 	__a     (		__lowerCamelCase,		__lowerCamelCase  ):
   forceWrite(f"""\033[{num_lines}{CURSOR_TO_CHAR[direction.upper()]}"""  )







def 	__a     (		):
   forceWrite(" " * TERMINAL_WIDTH  )
   reset_cursor()







def 	__a     (		):
   reset_cursor()
   forceWrite("-" * TERMINAL_WIDTH  )




"""simple docstring"""





from __future__ import annotations







def 	__a     (		__lowerCamelCase,		__lowerCamelCase  ):
   UpperCAmelCase_     ,   UpperCAmelCase_					:					str			     =    set(__lowerCamelCase  ), [start]

   while stack:
      UpperCAmelCase_					:					Any			     =    stack.pop()
      explored.add(__lowerCamelCase  )
      # 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(__lowerCamelCase  )
   return explored


_a		       =							{
    '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'))


