





def 			lowerCamelCase__	(__lowerCamelCase,				__lowerCamelCase		):
     _SCREAMING_SNAKE_CASE				:		Dict  			=							sorted(__lowerCamelCase,				key=lambda __lowerCamelCase		: edge[2]		)

     _SCREAMING_SNAKE_CASE				:		Optional[int]  			=							list(range(__lowerCamelCase		)		)

     def find_parent(__lowerCamelCase		):
          if i != parent[i]:
               _SCREAMING_SNAKE_CASE				:		Tuple  			=							find_parent(parent[i]		)
          return parent[i]

     _SCREAMING_SNAKE_CASE				:		List[Any]  			=							0
     _SCREAMING_SNAKE_CASE				:		Union[str, Any]  			=							[]

     for edge in edges:
          _SCREAMING_SNAKE_CASE				:		Any  			=							find_parent(edge[0]		)
          _SCREAMING_SNAKE_CASE				:		Optional[int]  			=							find_parent(edge[1]		)
          if parent_a != parent_b:
               minimum_spanning_tree_cost += edge[2]
               minimum_spanning_tree.append(__lowerCamelCase		)
               _SCREAMING_SNAKE_CASE				:		Dict  			=							parent_b

     return minimum_spanning_tree


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

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

       kruskal(num_nodes, edges)




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


UpperCamelCase_	       =   {"configuration_vit_hybrid": ["VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTHybridConfig"]}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCamelCase_	       =   [
							    "VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST",
							    "ViTHybridForImageClassification",
							    "ViTHybridModel",
							    "ViTHybridPreTrainedModel",
							]

try:
							if not is_vision_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCamelCase_	       =   ["ViTHybridImageProcessor"]


if TYPE_CHECKING:
							from .configuration_vit_hybrid import VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTHybridConfig

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_vit_hybrid import (
														    VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST,
														    ViTHybridForImageClassification,
														    ViTHybridModel,
														    ViTHybridPreTrainedModel,
														)

							try:
														if not is_vision_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .image_processing_vit_hybrid import ViTHybridImageProcessor


else:
							import sys

							UpperCamelCase_	       =   _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)





