





'''simple docstring'''

from __future__ import annotations

a        =						{
    "A": ["B", "C", "E"],
    "B": ["A", "D", "E"],
    "C": ["A", "F", "G"],
    "D": ["B"],
    "E": ["A", "B", "D"],
    "F": ["C"],
    "G": ["C"],
}







class __a :





   def __init__(					self				:			List[Any]				,lowerCamelCase				:			dict[str, list[str]]				,lowerCamelCase				:			str    ):

      '''simple docstring'''

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





   def      UpperCAmelCase__     (					self				:			Tuple    ):

      '''simple docstring'''

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

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





   def      UpperCAmelCase__     (					self				:			str				,lowerCamelCase				:			str    ):

      '''simple docstring'''

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

      __SCREAMING_SNAKE_CASE      							=       self.parent.get(_snake_case    )
      if target_vertex_parent is None:
         __SCREAMING_SNAKE_CASE      							=       (
             f"""No path from vertex: {self.source_vertex} to vertex: {target_vertex}"""
         )
         raise ValueError(_snake_case    )

      return self.shortest_path(_snake_case    ) + f"""->{target_vertex}"""


if __name__ == "__main__":
    a        =						Graph(graph, "G")
    g.breath_first_search()
    print(g.shortest_path("D"))
    print(g.shortest_path("G"))
    print(g.shortest_path("Foo"))









'''simple docstring'''

def 						__magic_name__       (							__UpperCAmelCase      )						->					bool:

   '''simple docstring'''







   if num < 0:
      return False

   __SCREAMING_SNAKE_CASE      							=       num
   __SCREAMING_SNAKE_CASE      							=       0
   while num > 0:
      __SCREAMING_SNAKE_CASE      							=       rev_num * 10 + (num % 10)
      num //= 10

   return num_copy == rev_num


if __name__ == "__main__":
    import doctest

    doctest.testmod()





