





'''simple docstring'''

from __future__ import annotations

from typing import Generic, TypeVar

lowercase__		:     Any			=							TypeVar('T')
class 							__lowerCAmelCase	(       Generic[T]					):






       """simple docstring"""





       def __init__(				self  :						int			,					lowerCAmelCase__  :						T	)       ->	None:

            '''simple docstring'''




            _UpperCamelCase							       =			data
            _UpperCamelCase							       =			self
            _UpperCamelCase							       =			0

class 							__lowerCAmelCase	(       Generic[T]					):






       """simple docstring"""





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

            '''simple docstring'''




            _UpperCamelCase							       =			{}





       def snake_case__		(				self  :						List[str]			,					lowerCAmelCase__  :						T	)       ->	None:

            '''simple docstring'''




            _UpperCamelCase							       =			DisjointSetTreeNode(lowerCAmelCase__	)





       def snake_case__		(				self  :						Dict			,					lowerCAmelCase__  :						T	)       ->	DisjointSetTreeNode[T]:

            '''simple docstring'''




            _UpperCamelCase							       =			self.map[data]
            if elem_ref != elem_ref.parent:
                 _UpperCamelCase							       =			self.find_set(elem_ref.parent.data	)
            return elem_ref.parent





       def snake_case__		(				self  :						Optional[Any]			,					lowerCAmelCase__  :						DisjointSetTreeNode[T]			,					lowerCAmelCase__  :						DisjointSetTreeNode[T]	)       ->	None:

            '''simple docstring'''




            if nodea.rank > nodea.rank:
                 _UpperCamelCase							       =			nodea
            else:
                 _UpperCamelCase							       =			nodea
                 if nodea.rank == nodea.rank:
                      nodea.rank += 1







       def snake_case__		(				self  :						Any			,					lowerCAmelCase__  :						T			,					lowerCAmelCase__  :						T	)       ->	None:

            '''simple docstring'''




            self.link(self.find_set(lowerCAmelCase__	)			,					self.find_set(lowerCAmelCase__	)	)

class 							__lowerCAmelCase	(       Generic[T]					):






       """simple docstring"""





       def __init__(				self  :						Dict	)       ->	None:

            '''simple docstring'''




            _UpperCamelCase							       =			{}





       def snake_case__		(				self  :						Optional[Any]			,					lowerCAmelCase__  :						T	)       ->	None:

            '''simple docstring'''




            if node not in self.connections:
                 _UpperCamelCase							       =			{}





       def snake_case__		(				self  :						Tuple			,					lowerCAmelCase__  :						T			,					lowerCAmelCase__  :						T			,					lowerCAmelCase__  :						int	)       ->	None:

            '''simple docstring'''




            self.add_node(lowerCAmelCase__	)
            self.add_node(lowerCAmelCase__	)
            _UpperCamelCase							       =			weight
            _UpperCamelCase							       =			weight







       def snake_case__		(				self  :						Any	)       ->	GraphUndirectedWeighted[T]:

            '''simple docstring'''




            _UpperCamelCase							       =			[]
            _UpperCamelCase							       =			set()
            for start in self.connections:
                 for end in self.connections[start]:
                      if (start, end) not in seen:
                           seen.add((end, start)	)
                           edges.append((start, end, self.connections[start][end])	)
            edges.sort(key=lambda lowerCAmelCase__	: x[2]	)

            # creating the disjoint set
            _UpperCamelCase							       =			DisjointSetTree[T]()
            for node in self.connections:
                 disjoint_set.make_set(lowerCAmelCase__	)

            # MST generation
            _UpperCamelCase							       =			0
            _UpperCamelCase							       =			0
            _UpperCamelCase							       =			GraphUndirectedWeighted[T]()
            while num_edges < len(self.connections	) - 1:
                 _UpperCamelCase       ,							_UpperCamelCase       ,							_UpperCamelCase							       =			edges[index]
                 index += 1
                 _UpperCamelCase							       =			disjoint_set.find_set(lowerCAmelCase__	)
                 _UpperCamelCase							       =			disjoint_set.find_set(lowerCAmelCase__	)
                 if parent_u != parent_v:
                      num_edges += 1
                      graph.add_edge(lowerCAmelCase__			,					lowerCAmelCase__			,					lowerCAmelCase__	)
                      disjoint_set.union(lowerCAmelCase__			,					lowerCAmelCase__	)
            return graph







def 							__lowerCamelCase		(					UpperCAmelCase_		:						int					,    UpperCAmelCase_		:						int		):




      """simple docstring"""





      if b == 0:
            return 1
      if (b % 2) == 0:
            return actual_power(UpperCAmelCase_					,    int(b / 2		)		) * actual_power(UpperCAmelCase_					,    int(b / 2		)		)
      else:
            return a * actual_power(UpperCAmelCase_					,    int(b / 2		)		) * actual_power(UpperCAmelCase_					,    int(b / 2		)		)
def 							__lowerCamelCase		(					UpperCAmelCase_		:						int					,    UpperCAmelCase_		:						int		):




      """simple docstring"""





      if b < 0:
            return 1 / actual_power(UpperCAmelCase_					,    UpperCAmelCase_		)
      return actual_power(UpperCAmelCase_					,    UpperCAmelCase_		)


if __name__ == "__main__":
     print(power(-2, -3))





