




from __future__ import annotations

from collections import deque
from collections.abc import Iterator
from dataclasses import dataclass

@dataclass
class   __a:






    """simple docstring"""





    lowerCAmelCase        =				42
    lowerCAmelCase        =				42


class   __a:






    """simple docstring"""





    def __init__(				self       ,_SCREAMING_SNAKE_CASE  )			->		List[Any]:
      UpperCAmelCase_      :							list[list[Edge]]       =      [[] for _ in range(_SCREAMING_SNAKE_CASE  )]
      UpperCAmelCase_      :							Dict       =      size





    def __getitem__(				self       ,_SCREAMING_SNAKE_CASE  )			->		Iterator[Edge]:
      return iter(self._graph[vertex]  )





    @property
    def 							a__				(				self  )			->		str:
      return self._size





    def 							a__				(				self       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE  )			->		List[str]:
      if weight not in (0, 1):
        raise ValueError('''Edge weight must be either 0 or 1.'''  )

      if to_vertex < 0 or to_vertex >= self.size:
        raise ValueError('''Vertex indexes must be in [0; size).'''  )

      self._graph[from_vertex].append(Edge(_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE  )  )





    def 							a__				(				self       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE  )			->		int | None:
      UpperCAmelCase_      :							Dict       =      deque([start_vertex]  )
      UpperCAmelCase_      :							list[int | None]       =      [None] * self.size
      UpperCAmelCase_      :							Tuple       =      0

      while queue:
        UpperCAmelCase_      :							str       =      queue.popleft()
        UpperCAmelCase_      :							Optional[int]       =      distances[current_vertex]
        if current_distance is None:
          continue

        for edge in self[current_vertex]:
          UpperCAmelCase_      :							int       =      current_distance + edge.weight
          UpperCAmelCase_      :							Optional[Any]       =      distances[edge.destination_vertex]
          if (
              isinstance(_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE  )
              and new_distance >= dest_vertex_distance
          ):
            continue
          UpperCAmelCase_      :							Tuple       =      new_distance
          if edge.weight == 0:
            queue.appendleft(edge.destination_vertex  )
          else:
            queue.append(edge.destination_vertex  )

      if distances[finish_vertex] is None:
        raise ValueError('''No path from start_vertex to finish_vertex.'''  )

      return distances[finish_vertex]


if __name__ == "__main__":
     import doctest

     doctest.testmod()





from __future__ import annotations

from fractions import Fraction







def lowerCamelCase__       (      _lowercase			,						_lowercase				):

     '''simple docstring'''


     return (
         num != den and num % 10 == den // 10 and (num // 10) / (den % 10) == num / den
     )







def lowerCamelCase__       (      _lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							Optional[int]       =      []
     UpperCAmelCase_      :							Tuple       =      11
     UpperCAmelCase_      :							int       =      int('''1''' + '''0''' * digit_len				)
     for num in range(_lowercase			,						_lowercase				):
          while den <= 99:
               if (num != den) and (num % 10 == den // 10) and (den % 10 != 0):
                    if is_digit_cancelling(_lowercase			,						_lowercase				):
                         solutions.append(f'''{num}/{den}'''				)
               den += 1
          num += 1
          UpperCAmelCase_      :							Any       =      10
     return solutions







def lowerCamelCase__       (      _lowercase = 2				):

     '''simple docstring'''


     UpperCAmelCase_      :							Tuple       =      1.0
     for fraction in fraction_list(_lowercase				):
          UpperCAmelCase_      :							Optional[Any]       =      Fraction(_lowercase				)
          result *= frac.denominator / frac.numerator
     return int(_lowercase				)


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