
"""simple docstring"""

from __future__ import annotations

UpperCamelCase     :    List[str]       =			{
    "A": ["B", "C", "E"],
    "B": ["A", "D", "E"],
    "C": ["A", "F", "G"],
    "D": ["B"],
    "E": ["A", "B", "D"],
    "F": ["C"],
    "G": ["C"],
}

class __lowerCAmelCase		:





     def __init__(     self     ,					__UpperCAmelCase     ,					__UpperCAmelCase				):

      '''simple docstring'''




      __UpperCamelCase      =	graph
      # mapping node to its parent in resulting breadth first tree
      __UpperCamelCase      =	{}
      __UpperCamelCase      =	source_vertex





     def 						UpperCAmelCase (     self				):

      '''simple docstring'''




      __UpperCamelCase      =	{self.source_vertex}
      __UpperCamelCase      =	None
      __UpperCamelCase      =	[self.source_vertex]  # first in first out queue

      while queue:
       __UpperCamelCase      =	queue.pop(0				)
       for adjacent_vertex in self.graph[vertex]:
        if adjacent_vertex not in visited:
         visited.add(__UpperCAmelCase				)
         __UpperCamelCase      =	vertex
         queue.append(__UpperCAmelCase				)







     def 						UpperCAmelCase (     self     ,					__UpperCAmelCase				):

      '''simple docstring'''




      if target_vertex == self.source_vertex:
       return self.source_vertex

      __UpperCamelCase      =	self.parent.get(__UpperCAmelCase				)
      if target_vertex_parent is None:
       __UpperCamelCase      =	(
           F'No path from vertex: {self.source_vertex} to vertex: {target_vertex}'
       )
       raise ValueError(__UpperCAmelCase				)

      return self.shortest_path(__UpperCAmelCase				) + F'->{target_vertex}'


if __name__ == "__main__":
      UpperCamelCase     :    Union[str, Any]       =			Graph(graph, "G")
      g.breath_first_search()
      print(g.shortest_path("D"))
      print(g.shortest_path("G"))
      print(g.shortest_path("Foo"))





"""simple docstring"""

from math import factorial

UpperCamelCase     :    List[Any]       =			{str(d): factorial(d) for d in range(1_0)}






def 							A						(    snake_case				:int		)				->     int:
 return sum(DIGIT_FACTORIAL[d] for d in str(snake_case		)		)






def 							A						(    )				->     int:
 __UpperCamelCase      =	7 * factorial(9		) + 1
 return sum(i for i in range(3    , snake_case		) if sum_of_digit_factorial(snake_case		) == i		)


if __name__ == "__main__":
      print(f'''{solution() = }''')



