



'''simple docstring'''






from __future__ import annotations
def       lowerCamelCase__       (						_A ,			_A				):
  a						:					str        =     set(__lowerCamelCase				), [start]

  while stack:
    a						:					Tuple        =     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


lowerCAmelCase:					Union[str, Any]						       =						{
    "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'))







from functools import lru_cache






@lru_cache
def 				lowerCamelCase__      (    __lowerCamelCase			:     int		):
  if num < 0:
    raise ValueError("""Number should not be negative."""		)

  return 1 if num in (0, 1) else num * factorial(num - 1		)


if __name__ == "__main__":
       import doctest

       doctest.testmod()


