
'''simple docstring'''


def lowercase_		(				_lowercase     ,    _lowercase			)       ->							list[tuple[int, int, int]]:
					'''simple docstring'''

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

					lowerCamelCase_   : Tuple       =						list(range(_lowercase			)			)

					def find_parent(_lowercase			):
										if i != parent[i]:
															lowerCamelCase_   : List[Any]       =						find_parent(parent[i]			)
										return parent[i]

					lowerCamelCase_   : List[Any]       =						0
					lowerCamelCase_   : Dict       =						[]

					for edge in edges:
										lowerCamelCase_   : str       =						find_parent(edge[0]			)
										lowerCamelCase_   : Dict       =						find_parent(edge[1]			)
										if parent_a != parent_b:
															minimum_spanning_tree_cost += edge[2]
															minimum_spanning_tree.append(_lowercase			)
															lowerCamelCase_   : int       =						parent_b

					return minimum_spanning_tree


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

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

					kruskal(num_nodes, edges)




'''simple docstring'''


def lowercase_		(				_lowercase			)       ->							int:
					'''simple docstring'''

					if not isinstance(_lowercase     ,    _lowercase			):
										raise TypeError('''recursive_lucas_number accepts only integer arguments.'''			)
					if n_th_number == 0:
										return 2
					if n_th_number == 1:
										return 1

					return recursive_lucas_number(n_th_number - 1			) + recursive_lucas_number(
					    n_th_number - 2			)




def lowercase_		(				_lowercase			)       ->							int:
					'''simple docstring'''

					if not isinstance(_lowercase     ,    _lowercase			):
										raise TypeError('''dynamic_lucas_number accepts only integer arguments.'''			)
					lowerCamelCase_, lowerCamelCase_   : List[Any]       =						2, 1
					for _ in range(_lowercase			):
										lowerCamelCase_, lowerCamelCase_   : Dict       =						b, a + b
					return a


if __name__ == "__main__":
					from doctest import testmod

					testmod()
					__lowercase							:				Any					=       int(input('''Enter the number of terms in lucas series:\n''').strip())
					print('''Using recursive function to calculate lucas series:''')
					print(''' '''.join(str(recursive_lucas_number(i)) for i in range(n)))
					print('''\nUsing dynamic function to calculate lucas series:''')
					print(''' '''.join(str(dynamic_lucas_number(i)) for i in range(n)))


