






"""simple docstring"""



def 						_SCREAMING_SNAKE_CASE			(   __snake_case      :  Dict		, __snake_case      :  int   ):





     '''simple docstring'''





     lowercase							   =	sorted(lowercase_		, key=lambda __snake_case   : edge[2]   )

     lowercase							   =	list(range(lowercase_   )   )

     def find_parent(__snake_case      :  Union[str, Any]   ):
          if i != parent[i]:
               lowercase							   =	find_parent(parent[i]   )
          return parent[i]

     lowercase							   =	0
     lowercase							   =	[]

     for edge in edges:
          lowercase							   =	find_parent(edge[0]   )
          lowercase							   =	find_parent(edge[1]   )
          if parent_a != parent_b:
               minimum_spanning_tree_cost += edge[2]
               minimum_spanning_tree.append(lowercase_   )
               lowercase							   =	parent_b

     return minimum_spanning_tree


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

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

    kruskal(num_nodes, edges)










"""simple docstring"""



def 						_SCREAMING_SNAKE_CASE			(   __snake_case      :  Dict		, __snake_case      :  str   ):





  '''simple docstring'''





  lowercase							   =	1
  while b > 0:
    if b & 1:
      res *= a

    a *= a
    b >>= 1

  return res
def 						_SCREAMING_SNAKE_CASE			(   __snake_case      :  int		, __snake_case      :  List[str]		, __snake_case      :  str   ):





  '''simple docstring'''





  lowercase							   =	1
  while b > 0:
    if b & 1:
      lowercase							   =	((res % c) * (a % c)) % c

    a *= a
    b >>= 1

  return res


