

'''simple docstring'''

from __future__ import annotations

from typing import Generic, TypeVar

A_       						=							TypeVar("T")





class 							_snake_case (       Generic[T]						):
   def __init__( self			:      Union[str, Any]     ,SCREAMING_SNAKE_CASE__			:      T							):
    SCREAMING_SNAKE_CASE:Optional[Any]						      =					data
    SCREAMING_SNAKE_CASE:int						      =					self
    SCREAMING_SNAKE_CASE:List[Any]						      =					0





class 							_snake_case (       Generic[T]						):
   def __init__( self			:      str							):
    SCREAMING_SNAKE_CASE:Optional[Any]						      =					{}
   def     __UpperCamelCase						( self			:      List[str]     ,SCREAMING_SNAKE_CASE__			:      T							):
    SCREAMING_SNAKE_CASE:int						      =					DisjointSetTreeNode(SCREAMING_SNAKE_CASE__							)
   def     __UpperCamelCase						( self			:      Dict     ,SCREAMING_SNAKE_CASE__			:      T							):
    SCREAMING_SNAKE_CASE:Optional[int]						      =					self.map[data]
    if elem_ref != elem_ref.parent:
     SCREAMING_SNAKE_CASE:List[str]						      =					self.find_set(elem_ref.parent.data							)
    return elem_ref.parent
   def     __UpperCamelCase						( self			:      List[Any]     ,SCREAMING_SNAKE_CASE__			:      DisjointSetTreeNode[T]     ,SCREAMING_SNAKE_CASE__			:      DisjointSetTreeNode[T]							):

    if nodea.rank > nodea.rank:
     SCREAMING_SNAKE_CASE:Optional[Any]						      =					nodea
    else:
     SCREAMING_SNAKE_CASE:str						      =					nodea
     if nodea.rank == nodea.rank:
      nodea.rank += 1







   def     __UpperCamelCase						( self			:      str     ,SCREAMING_SNAKE_CASE__			:      T     ,SCREAMING_SNAKE_CASE__			:      T							):
    self.link(self.find_set(SCREAMING_SNAKE_CASE__							)     ,self.find_set(SCREAMING_SNAKE_CASE__							)							)





class 							_snake_case (       Generic[T]						):
   def __init__( self			:      Optional[int]							):
    SCREAMING_SNAKE_CASE:Any						      =					{}
   def     __UpperCamelCase						( self			:      List[str]     ,SCREAMING_SNAKE_CASE__			:      T							):

    if node not in self.connections:
     SCREAMING_SNAKE_CASE:Optional[Any]						      =					{}
   def     __UpperCamelCase						( self			:      Optional[Any]     ,SCREAMING_SNAKE_CASE__			:      T     ,SCREAMING_SNAKE_CASE__			:      T     ,SCREAMING_SNAKE_CASE__			:      int							):
    self.add_node(SCREAMING_SNAKE_CASE__							)
    self.add_node(SCREAMING_SNAKE_CASE__							)
    SCREAMING_SNAKE_CASE:Any						      =					weight
    SCREAMING_SNAKE_CASE:Optional[Any]						      =					weight







   def     __UpperCamelCase						( self			:      Optional[Any]							):
    SCREAMING_SNAKE_CASE:int						      =					[]
    SCREAMING_SNAKE_CASE:List[Any]						      =					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 SCREAMING_SNAKE_CASE__							: x[2]							)

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

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









'''simple docstring'''

def    A_  ( snake_case = 100 ):
  SCREAMING_SNAKE_CASE:Dict						      =					0
  SCREAMING_SNAKE_CASE:Optional[int]						      =					0
  for i in range(1      ,       n + 1 ):
    sum_of_squares += i**2
    sum_of_ints += i
  return sum_of_ints**2 - sum_of_squares


if __name__ == "__main__":
    print(f'''{solution() = }''')






