






def    a__    (	A		,					A       ):
   lowercase__    :						Dict       =			sorted(A		,					key=lambda A       : edge[2]       )

   lowercase__    :						Optional[int]       =			list(range(A       )       )

   def find_parent(A       ):
      if i != parent[i]:
         lowercase__    :						Dict       =			find_parent(parent[i]       )
      return parent[i]

   lowercase__    :						str       =			0
   lowercase__    :						Union[str, Any]       =			[]

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

   return minimum_spanning_tree


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

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

 kruskal(num_nodes, edges)









import unittest
from pathlib import Path

from transformers import is_vision_available, load_tool
from transformers.testing_utils import get_tests_dir

from .test_tools_common import ToolTesterMixin


if is_vision_available():
       from PIL import Image

class 			__A(    unittest.TestCase    ,      __UpperCAmelCase			):

     def 						_UpperCamelCase  (   self   ):





            """simple docstring"""

            _UpperCamelCase														=    load_tool('''image-question-answering'''   )
            self.tool.setup()
            _UpperCamelCase														=    load_tool('''image-question-answering''',							remote=A   )

     def 						_UpperCamelCase  (   self   ):





            """simple docstring"""

            _UpperCamelCase														=    Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''   )   ) / '''000000039769.png'''   )
            _UpperCamelCase														=    self.tool(A,							'''How many cats are sleeping on the couch?'''   )
            self.assertEqual(A,							'''2'''   )

     def 						_UpperCamelCase  (   self   ):





            """simple docstring"""

            _UpperCamelCase														=    Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''   )   ) / '''000000039769.png'''   )
            _UpperCamelCase														=    self.remote_tool(A,							'''How many cats are sleeping on the couch?'''   )
            self.assertEqual(A,							'''2'''   )

     def 						_UpperCamelCase  (   self   ):





            """simple docstring"""

            _UpperCamelCase														=    Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''   )   ) / '''000000039769.png'''   )
            _UpperCamelCase														=    self.tool(image=A,							question='''How many cats are sleeping on the couch?'''   )
            self.assertEqual(A,							'''2'''   )



     def 						_UpperCamelCase  (   self   ):





            """simple docstring"""

            _UpperCamelCase														=    Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''   )   ) / '''000000039769.png'''   )
            _UpperCamelCase														=    self.remote_tool(image=A,							question='''How many cats are sleeping on the couch?'''   )
            self.assertEqual(A,							'''2'''   )






