def 	__lowerCamelCase							(				__a    : int      ,							__a    : Tuple		)      ->       list[tuple[int, int, int]]:
	_lowercase   =sorted(lowercase_      ,							key=lambda __a		: edge[2]		)

	_lowercase   =list(range(lowercase_		)		)

	def find_parent(__a    : int		):
		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
						lowerCAmelCase__	,					lowerCAmelCase__  	=      list(map(int, input().strip().split()))
						lowerCAmelCase__  	=      []

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

						kruskal(num_nodes, edges)










"""simple docstring"""



import os

from apache_beam.io.filesystems import FileSystems
from apache_beam.pipeline import Pipeline

from .logging import get_logger


SCREAMING_SNAKE_CASE							=			2 << 20  # 2mb
SCREAMING_SNAKE_CASE							=			get_logger(__name__)




class       UpperCAmelCase_    (		A_				):




    def 				__magic_name__				(       self		:			Tuple ) ->				Optional[int]:




     '''simple docstring'''

     A__			=							self._options.get_all_options().get("runner" )
     return runner in [None, "DirectRunner", "PortableRunner"]







def     _SCREAMING_SNAKE_CASE  (				lowercase_     ,					lowercase_     ,					lowercase_=False		)		->						Dict:
 A__			=							FileSystems
 if fs.exists(lowercase_		):
  if force_upload:
   logger.info(f"""Remote path already exist: {remote_file_path}. Overwriting it as force_upload=True."""		)
  else:
   logger.info(f"""Remote path already exist: {remote_file_path}. Skipping it as force_upload=False."""		)
   return
 with fs.create(lowercase_		) as remote_file:
  with open(lowercase_     ,					"rb"		) as local_file:
   A__			=							local_file.read(lowercase_		)
   while chunk:
    remote_file.write(lowercase_		)
    A__			=							local_file.read(lowercase_		)







def     _SCREAMING_SNAKE_CASE  (				lowercase_     ,					lowercase_     ,					lowercase_=False		)		->						int:
 A__			=							FileSystems
 if os.path.exists(lowercase_		):
  if force_download:
   logger.info(f"""Local path already exist: {remote_file_path}. Overwriting it as force_upload=True."""		)
  else:
   logger.info(f"""Local path already exist: {remote_file_path}. Skipping it as force_upload=False."""		)
   return
 with fs.open(lowercase_		) as remote_file:
  with open(lowercase_     ,					"wb"		) as local_file:
   A__			=							remote_file.read(lowercase_		)
   while chunk:
    local_file.write(lowercase_		)
    A__			=							remote_file.read(lowercase_		)





