





import heapq as hq
import math
from collections.abc import Iterator


class        __magic_name__	:





     """simple docstring"""



     def __init__(				self							:List[str]      ,   snake_case							:Union[str, Any]	):





        '''simple docstring'''




        A_       :					str        =      str(id_	)
        A_       :					Optional[Any]        =      None
        A_       :					Optional[Any]        =      None
        A_       :					Tuple        =      []
        A_       :					Any        =      {}  # {vertex:distance}



     def __lt__(				self							:Tuple      ,   snake_case							:Any	):





        '''simple docstring'''




        return self.key < other.key



     def __repr__(				self							:int	):





        '''simple docstring'''




        return self.id



     def     SCREAMING_SNAKE_CASE		(				self							:Tuple      ,   snake_case							:str	):





        '''simple docstring'''




        self.neighbors.append(snake_case	)





     def     SCREAMING_SNAKE_CASE		(				self							:List[str]      ,   snake_case							:int      ,   snake_case							:List[Any]	):





        '''simple docstring'''




        A_       :					List[Any]        =      weight




def   __snake_case    (       _lowerCAmelCase			:			Optional[int]					,					_lowerCAmelCase			:			Optional[Any]					,					_lowerCAmelCase			:			List[Any]					,					_lowerCAmelCase			:			List[Any]						)			->    Optional[int]:
   # add the neighbors:
   graph[a - 1].add_neighbor(graph[b - 1]						)
   graph[b - 1].add_neighbor(graph[a - 1]						)
   # add the edges:
   graph[a - 1].add_edge(graph[b - 1]					,					_lowerCAmelCase						)
   graph[b - 1].add_edge(graph[a - 1]					,					_lowerCAmelCase						)

def   __snake_case    (       _lowerCAmelCase			:			list					,					_lowerCAmelCase			:			Vertex						)			->    list:
   A_       :					Any        =      []
   for u in graph:
      A_       :					str        =      math.inf
      A_       :					Any        =      None
   A_       :					Tuple        =      0
   A_       :					Any        =      graph[:]
   while q:
      A_       :					Union[str, Any]        =      min(_lowerCAmelCase						)
      q.remove(_lowerCAmelCase						)
      for v in u.neighbors:
         if (v in q) and (u.edges[v.id] < v.key):
            A_       :					Any        =      u
            A_       :					Dict        =      u.edges[v.id]
   for i in range(1					,					len(_lowerCAmelCase						)						):
      a.append((int(graph[i].id						) + 1, int(graph[i].pi.id						) + 1)						)
   return a

def   __snake_case    (       _lowerCAmelCase			:			list					,					_lowerCAmelCase			:			Vertex						)			->    Iterator[tuple]:
   for u in graph:
      A_       :					List[str]        =      math.inf
      A_       :					Union[str, Any]        =      None
   A_       :					Union[str, Any]        =      0

   A_       :					int        =      list(_lowerCAmelCase						)
   hq.heapify(_lowerCAmelCase						)

   while h:
      A_       :					Union[str, Any]        =      hq.heappop(_lowerCAmelCase						)
      for v in u.neighbors:
         if (v in h) and (u.edges[v.id] < v.key):
            A_       :					Union[str, Any]        =      u
            A_       :					int        =      u.edges[v.id]
            hq.heapify(_lowerCAmelCase						)

   for i in range(1					,					len(_lowerCAmelCase						)						):
      yield (int(graph[i].id						) + 1, int(graph[i].pi.id						) + 1)

def   __snake_case    (       )			->    None:
   pass


if __name__ == "__main__":
 import doctest

 doctest.testmod()







from __future__ import annotations

from cmath import sqrt

def   __snake_case    (       _lowerCAmelCase			:			int					,					_lowerCAmelCase			:			int					,					_lowerCAmelCase			:			int						)			->    tuple[complex, complex]:

   if a == 0:
      raise ValueError("Coefficient 'a' must not be zero."						)
   A_       :					Tuple        =      b * b - 4 * a * c

   A_       :					Any        =      (-b + sqrt(_lowerCAmelCase						)) / (2 * a)
   A_       :					Union[str, Any]        =      (-b - sqrt(_lowerCAmelCase						)) / (2 * a)

   return (
       root_a.real if not root_a.imag else root_a,
       root_a.real if not root_a.imag else root_a,
   )

def   __snake_case    (       )			->    List[Any]:
   A_   ,    A_       :					Optional[Any]        =      quadratic_roots(a=5					,					b=6					,					c=1						)
   print(f"The solutions are: {solutiona} and {solutiona}"						)


if __name__ == "__main__":
 main()
