


'''simple docstring'''







def 	lowercase (_A      ,  _A    ):







       """simple docstring"""







       _lowerCAmelCase			:							Optional[Any]      	=				sorted(_a      ,  key=lambda _A    : edge[2]    )

       _lowerCAmelCase			:							str      	=				list(range(_a    )    )

       def find_parent(_A    ):
              if i != parent[i]:
                     _lowerCAmelCase			:							Any      	=				find_parent(parent[i]    )
              return parent[i]

       _lowerCAmelCase			:							Tuple      	=				0
       _lowerCAmelCase			:							Tuple      	=				[]

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

       return minimum_spanning_tree


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

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

       kruskal(num_nodes, edges)









from __future__ import annotations

from collections.abc import Generator

def    lowerCAmelCase__		(			_a				:	int			):
		if not isinstance(_a     ,					_a			) or n < 1:
				raise Exception("Sequence only defined for positive integers"			)

		yield n
		while n != 1:
				if n % 2 == 0:
						n //= 2
				else:
						snake_case_ :							List[str]         =				3 * n + 1
				yield n

def    lowerCAmelCase__		(			):
		snake_case_ :							Optional[int]         =				43
		snake_case_ :							Union[str, Any]         =				tuple(collatz_sequence(_a			)			)
		print(_a			)
		print(F'''Collatz sequence from {n} took {len(_a			)} steps.'''			)


if __name__ == "__main__":
							main()
