





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)

"""simple docstring"""

from dataclasses import dataclass
from typing import List, Optional, Union

import numpy as np
import PIL
from PIL import Image

from ...utils import is_torch_available, is_transformers_available


if is_transformers_available() and is_torch_available():
   from .image_encoder import PaintByExampleImageEncoder
   from .pipeline_paint_by_example import PaintByExamplePipeline



