'''simple docstring'''




def      UpperCamelCase_							( _UpperCAmelCase  :				Optional[int]      ,     _UpperCAmelCase  :				List[Any]   )   ->   List[str]:


       """simple docstring"""







       if len(str(_UpperCAmelCase   )   ) == 1 or len(str(_UpperCAmelCase   )   ) == 1:
              return a * b

       _UpperCAmelCase					:  Any											=   max(len(str(_UpperCAmelCase   )   )      ,     len(str(_UpperCAmelCase   )   )   )
       _UpperCAmelCase					:  Any											=   ma // 2

       _UpperCAmelCase				,  _UpperCAmelCase					:  Union[str, Any]											=   divmod(_UpperCAmelCase      ,     10**ma   )
       _UpperCAmelCase				,  _UpperCAmelCase					:  int											=   divmod(_UpperCAmelCase      ,     10**ma   )

       _UpperCAmelCase					:  List[str]											=   karatsuba(_UpperCAmelCase      ,     _UpperCAmelCase   )
       _UpperCAmelCase					:  int											=   karatsuba((aa + aa)      ,     (ba + ba)   )
       _UpperCAmelCase					:  Any											=   karatsuba(_UpperCAmelCase      ,     _UpperCAmelCase   )

       return (z * 10 ** (2 * ma)) + ((y - z - x) * 10 ** (ma)) + (x)

def      UpperCamelCase_							( )   ->   List[str]:


       """simple docstring"""







       print(karatsuba(15_463      ,     23_489   )   )


if __name__ == "__main__":
  main()


'''simple docstring'''




def      UpperCamelCase_							( _UpperCAmelCase  :				int      ,     _UpperCAmelCase  :				list[tuple[int, int, int]]   )   ->   list[tuple[int, int, int]]:


       """simple docstring"""







       _UpperCAmelCase					:  Optional[int]											=   sorted(_UpperCAmelCase      ,     key=lambda _UpperCAmelCase   : edge[2]   )

       _UpperCAmelCase					:  Optional[int]											=   list(range(_UpperCAmelCase   )   )

       def find_parent(_UpperCAmelCase  :				Dict   ):
              if i != parent[i]:
                     _UpperCAmelCase					:  Tuple											=   find_parent(parent[i]   )
              return parent[i]

       _UpperCAmelCase					:  Union[str, Any]											=   0
       _UpperCAmelCase					:  Dict											=   []

       for edge in edges:
              _UpperCAmelCase					:  List[str]											=   find_parent(edge[0]   )
              _UpperCAmelCase					:  str											=   find_parent(edge[1]   )
              if parent_a != parent_b:
                     minimum_spanning_tree_cost += edge[2]
                     minimum_spanning_tree.append(_UpperCAmelCase   )
                     _UpperCAmelCase					:  Optional[Any]											=   parent_b

       return minimum_spanning_tree


if __name__ == "__main__":  # pragma: no cover
  __SCREAMING_SNAKE_CASE					, __SCREAMING_SNAKE_CASE	:					int					=  list(map(int, input().strip().split()))
  __SCREAMING_SNAKE_CASE	:					str					=  []

  for _ in range(num_edges):
    __SCREAMING_SNAKE_CASE					, __SCREAMING_SNAKE_CASE					, __SCREAMING_SNAKE_CASE	:					str					=  (int(x) for x in input().strip().split())
    edges.append((nodea, nodea, cost))

  kruskal(num_nodes, edges)

