






"""simple docstring"""






import sys
from collections import defaultdict





class    snake_case_							:



	"""simple docstring"""

	def __init__(   self    ):


					"""simple docstring"""

					A__							=							[]


	def    _UpperCAmelCase    (   self	,       __a    ):


					"""simple docstring"""

					return self.node_position[vertex]


	def    _UpperCAmelCase    (   self	,       __a	,       __a    ):


					"""simple docstring"""

					A__							=							pos


	def    _UpperCAmelCase    (   self	,       __a	,       __a	,       __a	,       __a    ):


					"""simple docstring"""

					if start > size // 2 - 1:
									return
					else:
									if 2 * start + 2 >= size:
													A__							=							2 * start + 1
									else:
													if heap[2 * start + 1] < heap[2 * start + 2]:
																	A__							=							2 * start + 1
													else:
																	A__							=							2 * start + 2
									if heap[smallest_child] < heap[start]:
													A__			,      A__							=							heap[smallest_child], positions[smallest_child]
													A__			,      A__							=							(
													    heap[start],
													    positions[start],
													)
													A__			,      A__							=							temp, tempa

													A__							=							self.get_position(positions[smallest_child]    )
													self.set_position(
													    positions[smallest_child]	,       self.get_position(positions[start]    )    )
													self.set_position(positions[start]	,       a__    )

													self.top_to_bottom(a__	,       a__	,       a__	,       a__    )


	def    _UpperCAmelCase    (   self	,       __a	,       __a	,       __a	,       __a    ):


					"""simple docstring"""

					A__							=							position[index]

					while index != 0:
									A__							=							int((index - 2) / 2    ) if index % 2 == 0 else int((index - 1) / 2    )

									if val < heap[parent]:
													A__							=							heap[parent]
													A__							=							position[parent]
													self.set_position(position[parent]	,       a__    )
									else:
													A__							=							val
													A__							=							temp
													self.set_position(a__	,       a__    )
													break
									A__							=							parent
					else:
									A__							=							val
									A__							=							temp
									self.set_position(a__	,       0    )


	def    _UpperCAmelCase    (   self	,       __a	,       __a    ):


					"""simple docstring"""

					A__							=							len(a__    ) // 2 - 1
					for i in range(a__	,       -1	,       -1    ):
									self.top_to_bottom(a__	,       a__	,       len(a__    )	,       a__    )






	def    _UpperCAmelCase    (   self	,       __a	,       __a    ):


					"""simple docstring"""

					A__							=							positions[0]
					A__							=							sys.maxsize
					self.top_to_bottom(a__	,       0	,       len(a__    )	,       a__    )
					return temp





def 			__lowerCamelCase       (       lowerCAmelCase__					):
				A__							=							Heap()

				A__							=							[0] * len(UpperCamelCase_					)
				A__							=							[-1] * len(UpperCamelCase_					)  # Neighboring Tree Vertex of selected vertex
				# Minimum Distance of explored vertex with neighboring vertex of partial tree
				# formed in graph
				A__							=							[]  # Heap of Distance of vertices from their neighboring vertex
				A__							=							[]

				for vertex in range(len(UpperCamelCase_					)					):
								distance_tv.append(sys.maxsize					)
								positions.append(UpperCamelCase_					)
								heap.node_position.append(UpperCamelCase_					)

				A__							=							[]
				A__							=							1
				A__							=							sys.maxsize
				for neighbor, distance in adjacency_list[0]:
								A__							=							0
								A__							=							distance
				heap.heapify(UpperCamelCase_							,UpperCamelCase_					)

				for _ in range(1							,len(UpperCamelCase_					)					):
								A__							=							heap.delete_minimum(UpperCamelCase_							,UpperCamelCase_					)
								if visited[vertex] == 0:
												tree_edges.append((nbr_tv[vertex], vertex)					)
												A__							=							1
												for neighbor, distance in adjacency_list[vertex]:
																if (
																    visited[neighbor] == 0
																    and distance < distance_tv[heap.get_position(UpperCamelCase_					)]
																):
																				A__							=							distance
																				heap.bottom_to_top(
																				    UpperCamelCase_							,heap.get_position(UpperCamelCase_					)							,UpperCamelCase_							,UpperCamelCase_					)
																				A__							=							vertex
				return tree_edges


if __name__ == "__main__":  # pragma: no cover
					# < --------- Prims Algorithm --------- >
					SCREAMING_SNAKE_CASE    :    Optional[int]        =							int(input('''Enter number of edges: ''').strip())
					SCREAMING_SNAKE_CASE    :    Optional[int]        =							defaultdict(list)
					for _ in range(edges_number):
										SCREAMING_SNAKE_CASE    :    List[Any]        =							[int(x) for x in input().strip().split()]
										adjacency_list[edge[0]].append([edge[1], edge[2]])
										adjacency_list[edge[1]].append([edge[0], edge[2]])
					print(prisms_algorithm(adjacency_list))







_lowercase    	=		[0, 2, 4, 6, 8]
_lowercase    	=		[1, 3, 5, 7, 9]



def 		lowerCAmelCase__     (       UpperCamelCase_					:							int			,							UpperCamelCase_					:							int			,							UpperCamelCase_					:							list[int]			,							UpperCamelCase_					:							int						)->	int:
    if remaining_length == 0:
        if digits[0] == 0 or digits[-1] == 0:
            return 0

        for i in range(length // 2 - 1			,							-1			,							-1						):
            remainder += digits[i] + digits[length - i - 1]

            if remainder % 2 == 0:
                return 0

            remainder //= 1_0

        return 1

    if remaining_length == 1:
        if remainder % 2 == 0:
            return 0

        A__					=       0
        for digit in range(1_0						):
            A__					=       digit
            result += reversible_numbers(
                0			,							(remainder + 2 * digit) // 1_0			,							UpperCamelCase_			,							UpperCamelCase_						)
        return result

    A__					=       0
    for digita in range(1_0						):
        A__					=       digita

        if (remainder + digita) % 2 == 0:
            A__					=       ODD_DIGITS
        else:
            A__					=       EVEN_DIGITS

        for digita in other_parity_digits:
            A__					=       digita
            result += reversible_numbers(
                remaining_length - 2			,							(remainder + digita + digita) // 1_0			,							UpperCamelCase_			,							UpperCamelCase_			,							)
    return result



def 		lowerCAmelCase__     (       UpperCamelCase_					:							int = 9						)->	int:
    A__					=       0
    for length in range(1			,							max_power + 1						):
        result += reversible_numbers(UpperCamelCase_			,							0			,							[0] * length			,							UpperCamelCase_						)
    return result


if __name__ == "__main__":
   print(F"{solution() = }")
