






def    lowerCAmelCase__		(			_a				:	int     ,					_a				:	list[tuple[int, int, int]]			):
		snake_case_ :							Optional[Any]         =				sorted(_a     ,					key=lambda _a			: edge[2]			)

		snake_case_ :							str         =				list(range(_a			)			)

		def find_parent(_a				:	int			):
				if i != parent[i]:
						snake_case_ :							Any         =				find_parent(parent[i]			)
				return parent[i]

		snake_case_ :							Tuple         =				0
		snake_case_ :							Tuple         =				[]

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

		return minimum_spanning_tree


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

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

							kruskal(num_nodes, edges)








from __future__ import annotations

def    lowerCAmelCase__		(			_a				:	list[int]     ,					_a				:	int			):
		snake_case_       ,				snake_case_ :							Tuple         =				0, len(_a			) - 1
		while start_ind <= end_ind:
				if array[start_ind] == search_item:
						return start_ind
				elif array[end_ind] == search_item:
						return end_ind
				else:
						start_ind += 1
						end_ind -= 1
    # returns -1 if search_item is not found in array
		return -1


if __name__ == "__main__":
							print(double_linear_search(list(range(1_00)), 40))
