"""simple docstring"""




def   lowercase__     (			_UpperCAmelCase	,      _UpperCAmelCase				)     ->			list[tuple[int, int, int]]:






      '''simple docstring'''


      lowercase  :      Tuple					=   sorted(_UpperCAmelCase	,      key=lambda _UpperCAmelCase				: edge[2]				)

      lowercase  :      int					=   list(range(_UpperCAmelCase				)				)

      def find_parent(_UpperCAmelCase				):
            if i != parent[i]:
                  lowercase  :      List[Any]					=   find_parent(parent[i]				)
            return parent[i]

      lowercase  :      List[Any]					=   0
      lowercase  :      int					=   []

      for edge in edges:
            lowercase  :      str					=   find_parent(edge[0]				)
            lowercase  :      Union[str, Any]					=   find_parent(edge[1]				)
            if parent_a != parent_b:
                  minimum_spanning_tree_cost += edge[2]
                  minimum_spanning_tree.append(_UpperCAmelCase				)
                  lowercase  :      List[Any]					=   parent_b

      return minimum_spanning_tree


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

     for _ in range(num_edges):
          _UpperCamelCase							,					_UpperCamelCase							,					_UpperCamelCase:				List[str]    							=  (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


_UpperCamelCase:				int    							=  TypeVar('T', bound='TaskTemplate')


@dataclass(frozen=SCREAMING_SNAKE_CASE__     )
class   a__		(						abc.ABC     ):
   # `task` is not a ClassVar since we want it to be part of the `asdict` output for JSON serialization
   _lowerCamelCase												=				42
   _lowerCamelCase												=				42
   _lowerCamelCase												=				42


   def        lowercase				(							self      :							T,     lowerCAmelCase      :							Features			)    ->       T:
         return copy.deepcopy(self			)


   @property
   def        lowercase				(							self      :							Union[str, Any]			)    ->       Features:
         return Features(**self.input_schema,     **self.label_schema			)


   @property
   @abc.abstractmethod
   def        lowercase				(							self      :							Tuple			)    ->       Dict[str, str]:
         raise NotImplementedError






   @classmethod
   def        lowercase				(							cls      :							Type[T],     lowerCAmelCase      :							dict			)    ->       T:
         lowercase  :      Union[str, Any]					=   {f.name for f in dataclasses.fields(cls			)}
         return cls(**{k: v for k, v in template_dict.items() if k in field_names}			)
