


class      snake_case__	:
				def __init__(	self  ,   _UpperCAmelCase   ):




										"""simple docstring"""




										__magic_name__					:				Any				=   data
										__magic_name__					:				BinaryTreeNode | None				=   None
										__magic_name__					:				BinaryTreeNode | None				=   None






def 			__SCREAMING_SNAKE_CASE							(					lowercase__	:BinaryTreeNode | None   ,    lowercase__	:int					)							->	BinaryTreeNode | None:
						if node is None:
												__magic_name__					:				Optional[Any]				=   BinaryTreeNode(snake_case_					)
												return node

						# binary search tree is not empty,
						# so we will insert it into the tree
						# if new_value is less than value of data in node,
						#  add it to left subtree and proceed recursively
						if new_value < node.data:
												__magic_name__					:				List[Any]				=   insert(node.left_child   ,    snake_case_					)
						else:
												# if new_value is greater than value of data in node,
												#  add it to right subtree and proceed recursively
												__magic_name__					:				Tuple				=   insert(node.right_child   ,    snake_case_					)
						return node
def 			__SCREAMING_SNAKE_CASE							(					lowercase__	:None | BinaryTreeNode					)							->	list[int]:  # if node is None,return
						if node:
												__magic_name__					:				str				=   inorder(node.left_child					)
												__magic_name__					:				Optional[int]				=   [*inorder_array, node.data]
												__magic_name__					:				Tuple				=   inorder_array + inorder(node.right_child					)
						else:
												__magic_name__					:				Any				=   []
						return inorder_array
def 			__SCREAMING_SNAKE_CASE							(					)							->	BinaryTreeNode | None:
						__magic_name__					:				List[str]				=   insert(snake_case_   ,    1_5					)
						insert(snake_case_   ,    1_0					)
						insert(snake_case_   ,    2_5					)
						insert(snake_case_   ,    6					)
						insert(snake_case_   ,    1_4					)
						insert(snake_case_   ,    2_0					)
						insert(snake_case_   ,    6_0					)
						return root
def 			__SCREAMING_SNAKE_CASE							(					)							->	None:
						# main function
						__magic_name__					:				Dict				=   make_tree()
						print('Printing values of binary search tree in Inorder Traversal.'					)
						inorder(snake_case_					)


if __name__ == "__main__":
			import doctest

			doctest.testmod()
			main()




'''simple docstring'''

def        SCREAMING_SNAKE_CASE_  (	snake_case_				:	int   ,     snake_case_				:	list[tuple[int, int, int]]							)       ->	list[tuple[int, int, int]]:
 SCREAMING_SNAKE_CASE  :  List[Any]								=		sorted(snake_case_   ,     key=lambda snake_case_							: edge[2]							)

 SCREAMING_SNAKE_CASE  :  str								=		list(range(snake_case_							)							)

 def find_parent(snake_case_				:	Union[str, Any]							):
  if i != parent[i]:
   SCREAMING_SNAKE_CASE  :  int								=		find_parent(parent[i]							)
  return parent[i]

 SCREAMING_SNAKE_CASE  :  Union[str, Any]								=		0
 SCREAMING_SNAKE_CASE  :  Any								=		[]

 for edge in edges:
  SCREAMING_SNAKE_CASE  :  Dict								=		find_parent(edge[0]							)
  SCREAMING_SNAKE_CASE  :  Optional[int]								=		find_parent(edge[1]							)
  if parent_a != parent_b:
   minimum_spanning_tree_cost += edge[2]
   minimum_spanning_tree.append(snake_case_							)
   SCREAMING_SNAKE_CASE  :  Tuple								=		parent_b

 return minimum_spanning_tree


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

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

   kruskal(num_nodes, edges)


