





'''simple docstring'''


from __future__ import annotations

from fractions import Fraction






def  __lowerCAmelCase (__lowerCAmelCase      , __lowerCAmelCase   ):
		return (
		    num != den and num % 10 == den // 10 and (num // 10) / (den % 10) == num / den
		)






def  __lowerCAmelCase (__lowerCAmelCase   ):
		_UpperCAmelCase		:       Optional[Any]								=      []
		_UpperCAmelCase		:       Any								=      11
		_UpperCAmelCase		:       Union[str, Any]								=      int("1" + "0" * digit_len   )
		for num in range(__lowerCAmelCase      , __lowerCAmelCase   ):
				while den <= 99:
						if (num != den) and (num % 10 == den // 10) and (den % 10 != 0):
								if is_digit_cancelling(__lowerCAmelCase      , __lowerCAmelCase   ):
										solutions.append(F"""{num}/{den}"""   )
						den += 1
				num += 1
				_UpperCAmelCase		:       List[str]								=      10
		return solutions






def  __lowerCAmelCase (__lowerCAmelCase = 2   ):
		_UpperCAmelCase		:       Optional[int]								=      1.0
		for fraction in fraction_list(__lowerCAmelCase   ):
				_UpperCAmelCase		:       Dict								=      Fraction(__lowerCAmelCase   )
				result *= frac.denominator / frac.numerator
		return int(__lowerCAmelCase   )


if __name__ == "__main__":
						print(solution())







'''simple docstring'''


from __future__ import annotations

lowerCamelCase__    	=     {
    '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  :     int	,  lowerCamelCase__  :     dict[str, list[str]]	,  lowerCamelCase__  :     str )   ->None:



					'''simple docstring'''







					_UpperCAmelCase		:       Dict								=      graph
					# mapping node to its parent in resulting breadth first tree
					_UpperCAmelCase		:       dict[str, str | None]								=      {}
					_UpperCAmelCase		:       List[Any]								=      source_vertex




			def 							lowerCAmelCase__    (		self  :     Optional[int] )   ->None:



					'''simple docstring'''







					_UpperCAmelCase		:       List[Any]								=      {self.source_vertex}
					_UpperCAmelCase		:       List[Any]								=      None
					_UpperCAmelCase		:       List[str]								=      [self.source_vertex]  # first in first out queue

					while queue:
							_UpperCAmelCase		:       int								=      queue.pop(0 )
							for adjacent_vertex in self.graph[vertex]:
									if adjacent_vertex not in visited:
											visited.add(lowerCamelCase__ )
											_UpperCAmelCase		:       List[Any]								=      vertex
											queue.append(lowerCamelCase__ )






			def 							lowerCAmelCase__    (		self  :     Tuple	,  lowerCamelCase__  :     str )   ->str:



					'''simple docstring'''







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

					_UpperCAmelCase		:       int								=      self.parent.get(lowerCamelCase__ )
					if target_vertex_parent is None:
							_UpperCAmelCase		:       Tuple								=      (
							    F"""No path from vertex: {self.source_vertex} to vertex: {target_vertex}"""
							)
							raise ValueError(lowerCamelCase__ )

					return self.shortest_path(lowerCamelCase__ ) + F"""->{target_vertex}"""


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



