





def        __SCREAMING_SNAKE_CASE	(				__lowercase:		int  ,				__lowercase:		list[tuple[int, int, int]]):



  '''simple docstring'''






  __lowerCAmelCase								=					sorted(__lowercase  ,				key=lambda __lowercase: edge[2])

  __lowerCAmelCase								=					list(range(__lowercase))

  def find_parent(__lowercase:		Union[str, Any]):
    if i != parent[i]:
      __lowerCAmelCase								=					find_parent(parent[i])
    return parent[i]

  __lowerCAmelCase								=					0
  __lowerCAmelCase								=					[]

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

  return minimum_spanning_tree


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

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

      kruskal(num_nodes, edges)







def        __SCREAMING_SNAKE_CASE	(				__lowercase:		int):



  '''simple docstring'''






  if not isinstance(__lowercase  ,				__lowercase):
    __lowerCAmelCase								=					F'''Input value of [number={number}] must be an integer'''
    raise TypeError(__lowercase)
  if number < 0 or number % 2 == 1:
    return False
  __lowerCAmelCase								=					int(number**0.5)
  return number == number_sqrt * (number_sqrt + 1)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
