






def 			__lowerCamelCase     (						snake_case__			,snake_case__						)				->    list[tuple[int, int, int]]:






						"""simple docstring"""





						_SCREAMING_SNAKE_CASE       =    sorted(snake_case__			,key=lambda snake_case__						: edge[2]						)

						_SCREAMING_SNAKE_CASE       =    list(range(snake_case__						)						)

						def find_parent(snake_case__						):
												if i != parent[i]:
																		_SCREAMING_SNAKE_CASE       =    find_parent(parent[i]						)
												return parent[i]

						_SCREAMING_SNAKE_CASE       =    0
						_SCREAMING_SNAKE_CASE       =    []

						for edge in edges:
												_SCREAMING_SNAKE_CASE       =    find_parent(edge[0]						)
												_SCREAMING_SNAKE_CASE       =    find_parent(edge[1]						)
												if parent_a != parent_b:
																		minimum_spanning_tree_cost += edge[2]
																		minimum_spanning_tree.append(snake_case__						)
																		_SCREAMING_SNAKE_CASE       =    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)









import math
from timeit import timeit

def 			__lowerCamelCase     (						snake_case__						)				->    int:






						"""simple docstring"""





						_SCREAMING_SNAKE_CASE       =    0
						_SCREAMING_SNAKE_CASE       =    abs(snake_case__						)
						while True:
												_SCREAMING_SNAKE_CASE       =    n // 10
												digits += 1
												if n == 0:
																		break
						return digits

def 			__lowerCamelCase     (						snake_case__						)				->    int:






						"""simple docstring"""





						return 1 if n == 0 else math.floor(math.log(abs(snake_case__						)			,10						) + 1						)

def 			__lowerCamelCase     (						snake_case__						)				->    int:






						"""simple docstring"""





						return len(str(abs(snake_case__						)						)						)

def 			__lowerCamelCase     (						)				->    None:






						"""simple docstring"""





						from collections.abc import Callable

						def benchmark_a_function(snake_case__			,snake_case__						) -> None:
												_SCREAMING_SNAKE_CASE       =    F'{func.__name__}({value})'
												_SCREAMING_SNAKE_CASE       =    timeit(F'__main__.{call}'			,setup="""import __main__"""						)
												print(F'{call}: {func(snake_case__						)} -- {timing} seconds'						)

						for value in (26_21_44, 11_25_89_99_06_84_26_24, 1_26_76_50_60_02_28_22_94_01_49_67_03_20_53_76):
												for func in (num_digits, num_digits_fast, num_digits_faster):
																		benchmark_a_function(snake_case__			,snake_case__						)
												print()


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		benchmark()

