'''simple docstring'''





def   lowerCAmelCase_ (				__lowerCAmelCase						)->  List[Any]:






      '''simple docstring'''





      UpperCAmelCase    : Union[str, Any]      =len(UpperCamelCase_						)
      for i in range(length - 1						):
            UpperCAmelCase    : List[str]      =False
            for j in range(length - 1 - i						):
                  if collection[j] > collection[j + 1]:
                        UpperCAmelCase    : List[Any]      =True
                        UpperCAmelCase  ,						UpperCAmelCase    : int      =collection[j + 1], collection[j]
            if not swapped:
                  break  # Stop iteration if the collection is sorted.
      return collection


if __name__ == "__main__":
     import doctest
     import time

     doctest.testmod()

     __snake_case			      =    input('''Enter numbers separated by a comma:''').strip()
     __snake_case			      =    [int(item) for item in user_input.split(''',''')]
     __snake_case			      =    time.process_time()
     print(*bubble_sort(unsorted), sep=''',''')
     print(f'Processing time: {(time.process_time() - start)%1e9 + 7}')

def   lowerCAmelCase_ (				__lowerCAmelCase		,					__lowerCAmelCase						)->  list[tuple[int, int, int]]:






      '''simple docstring'''





      UpperCAmelCase    : List[Any]      =sorted(__lowerCAmelCase		,					key=lambda __lowerCAmelCase						: edge[2]						)

      UpperCAmelCase    : Union[str, Any]      =list(range(__lowerCAmelCase						)						)

      def find_parent(__lowerCAmelCase						):
            if i != parent[i]:
                  UpperCAmelCase    : Optional[int]      =find_parent(parent[i]						)
            return parent[i]

      UpperCAmelCase    : Optional[Any]      =0
      UpperCAmelCase    : List[str]      =[]

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

      return minimum_spanning_tree


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

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

     kruskal(num_nodes, edges)
