





from __future__ import annotations

from typing import Any
class        SCREAMING_SNAKE_CASE     :


   def __init__(					self    :       Optional[Any]    ,  a    :       Tuple )->     None:





     """simple docstring"""







     lowercase__			    =						num_of_nodes
     lowercase__			    =						[]
     lowercase__			    =						{}


   def  SCREAMING_SNAKE_CASE_							(					self    :       Union[str, Any]    ,  a    :       Any    ,  a    :       Union[str, Any]    ,  a    :       Optional[int] )->     None:





     """simple docstring"""







     self.m_edges.append([u_node, v_node, weight] )


   def  SCREAMING_SNAKE_CASE_							(					self    :       Optional[int]    ,  a    :       Union[str, Any] )->     int:





     """simple docstring"""







     if self.m_component[u_node] == u_node:
       return u_node
     return self.find_component(self.m_component[u_node] )


   def  SCREAMING_SNAKE_CASE_							(					self    :       Tuple    ,  a    :       Dict )->     None:





     """simple docstring"""







     if self.m_component[u_node] != u_node:
       for k in self.m_component:
         lowercase__			    =						self.find_component(_SCREAMING_SNAKE_CASE )


   def  SCREAMING_SNAKE_CASE_							(					self    :       Any    ,  a    :       Any    ,  a    :       List[Any]    ,  a    :       Any )->     None:





     """simple docstring"""







     if component_size[u_node] <= component_size[v_node]:
       lowercase__			    =						v_node
       component_size[v_node] += component_size[u_node]
       self.set_component(_SCREAMING_SNAKE_CASE )

     elif component_size[u_node] >= component_size[v_node]:
       lowercase__			    =						self.find_component(_SCREAMING_SNAKE_CASE )
       component_size[u_node] += component_size[v_node]
       self.set_component(_SCREAMING_SNAKE_CASE )


   def  SCREAMING_SNAKE_CASE_							(					self    :       Dict )->     None:





     """simple docstring"""







     lowercase__			    =						[]
     lowercase__			    =						0

     lowercase__			    =						[-1] * self.m_num_of_nodes

     # A list of components (initialized to all of the nodes)
     for node in range(self.m_num_of_nodes ):
       self.m_component.update({node: node} )
       component_size.append(1 )

     lowercase__			    =						self.m_num_of_nodes

     while num_of_components > 1:
       for edge in self.m_edges:
         lowercase__    ,					lowercase__    ,					lowercase__			    =						edge

         lowercase__			    =						self.m_component[u]
         lowercase__			    =						self.m_component[v]

         if u_component != v_component:

           for component in (u_component, v_component):
             if (
                 minimum_weight_edge[component] == -1
                 or minimum_weight_edge[component][2] > w
             ):
               lowercase__			    =						[u, v, w]

       for edge in minimum_weight_edge:
         if isinstance(_SCREAMING_SNAKE_CASE    ,  _SCREAMING_SNAKE_CASE ):
           lowercase__    ,					lowercase__    ,					lowercase__			    =						edge

           lowercase__			    =						self.m_component[u]
           lowercase__			    =						self.m_component[v]

           if u_component != v_component:
             mst_weight += w
             self.union(_SCREAMING_SNAKE_CASE    ,  _SCREAMING_SNAKE_CASE    ,  _SCREAMING_SNAKE_CASE )
             print(f"""Added edge [{u} - {v}]\nAdded weight: {w}\n""" )
             num_of_components -= 1

       lowercase__			    =						[-1] * self.m_num_of_nodes
     print(f"""The total weight of the minimal spanning tree is: {mst_weight}""" )







def     __UpperCamelCase						()       ->     None:
  pass


if __name__ == "__main__":
      import doctest

      doctest.testmod()









import math




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	)       ->     List[Any]:
  if 0 not in (x, y):
    # We use the relation x^y = y*log10(x), where 10 is the base.
    return y * math.logaa(_SCREAMING_SNAKE_CASE	)
  else:
    if x == 0:  # 0 raised to any number is 0
      return 0
    elif y == 0:
      return 1  # any number raised to 0 is 1
  raise AssertionError('This should never happen'	)


if __name__ == "__main__":  # Main function
      # Read two numbers from input and typecast them to int using map function.
      # Here x is the base and y is the power.
      lowercase_					     =	"""Enter the base and the power separated by a comma: """
      lowercase_     ,							lowercase_					     =	map(int, input(prompt).split(""","""))
      lowercase_     ,							lowercase_					     =	map(int, input(prompt).split(""","""))

      # We find the log of each number, using the function res(), which takes two
      # arguments.
      lowercase_					     =	res(xa, ya)
      lowercase_					     =	res(xa, ya)

      # We check for the largest number
      if resa > resa:
            print("""Largest number is""", xa, """^""", ya)
      elif resa > resa:
            print("""Largest number is""", xa, """^""", ya)
      else:
            print("""Both are equal""")


