


"""simple docstring"""






def 							A_					(   snake_case__					,				snake_case__		)				->     list[tuple[int, int, int]]:
			_UpperCamelCase				:str				    =  sorted(snake_case__					,				key=lambda snake_case__		: edge[2]		)

			_UpperCamelCase				:Any				    =  list(range(snake_case__		)		)

			def find_parent(snake_case__		):
						if i != parent[i]:
									_UpperCamelCase				:Dict				    =  find_parent(parent[i]		)
						return parent[i]

			_UpperCamelCase				:Optional[Any]				    =  0
			_UpperCamelCase				:int				    =  []

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

			return minimum_spanning_tree


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

					for _ in range(num_edges):
										UpperCamelCase__      , UpperCamelCase__      , UpperCamelCase__							:Dict       =  (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 ...utils import BaseOutput, is_invisible_watermark_available, is_torch_available, is_transformers_available






@dataclass
class     A(     lowerCamelCase__		):

		"""simple docstring"""





		A         =       42


if is_transformers_available() and is_torch_available() and is_invisible_watermark_available():
					from .pipeline_stable_diffusion_xl import StableDiffusionXLPipeline
					from .pipeline_stable_diffusion_xl_imgaimg import StableDiffusionXLImgaImgPipeline

