
"""simple docstring"""




def   UpperCamelCase_  (		SCREAMING_SNAKE_CASE_,					SCREAMING_SNAKE_CASE_      ):
     SCREAMING_SNAKE_CASE           =     sorted(_UpperCAmelCase,					key=lambda SCREAMING_SNAKE_CASE_      : edge[2]      )

     SCREAMING_SNAKE_CASE           =     list(range(_UpperCAmelCase      )      )

     def find_parent(SCREAMING_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(_UpperCAmelCase      )
               SCREAMING_SNAKE_CASE           =     parent_b

     return minimum_spanning_tree


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

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

 kruskal(num_nodes, edges)


"""simple docstring"""




import abc
import copy
import dataclasses
from dataclasses import dataclass
from typing import ClassVar, Dict, Type, TypeVar

from ..features import Features


snake_case			       =		TypeVar('T', bound='TaskTemplate')




@dataclass(frozen=__magic_name__				)
class 					UpperCamelCase     (	abc.ABC				):

				"""simple docstring"""



				UpperCAmelCase_    :				str
				UpperCAmelCase_    :				ClassVar[Features]
				UpperCAmelCase_    :				ClassVar[Features]


				def 							A (    self		,     lowercase__      )   ->   T:
									"""simple docstring"""







									return copy.deepcopy(self      )


				@property
				def 							A (    self      )   ->   Features:
									"""simple docstring"""







									return Features(**self.input_schema		,     **self.label_schema      )


				@property
				@abc.abstractmethod
				def 							A (    self      )   ->   Dict[str, str]:
									"""simple docstring"""







									raise NotImplementedError




				@classmethod
				def 							A (    cls		,     lowercase__      )   ->   T:
									"""simple docstring"""







									SCREAMING_SNAKE_CASE           =     {f.name for f in dataclasses.fields(cls      )}
									return cls(**{k: v for k, v in template_dict.items() if k in field_names}      )
