

import sys
from collections import defaultdict



class     _a						:


					'''simple docstring'''






					def __init__( self			):
						A__							:    Dict        =		[]






					def   __A			( self    ,       A__			):
						return self.node_position[vertex]






					def   __A			( self    ,       A__    ,       A__			):
						A__							:    str        =		pos






					def   __A			( self    ,       A__    ,       A__    ,       A__    ,       A__			):
						if start > size // 2 - 1:
							return
						else:
							if 2 * start + 2 >= size:
								A__							:    Union[str, Any]        =		2 * start + 1
							else:
								if heap[2 * start + 1] < heap[2 * start + 2]:
									A__							:    Union[str, Any]        =		2 * start + 1
								else:
									A__							:    int        =		2 * start + 2
							if heap[smallest_child] < heap[start]:
								A__   ,   A__							:    Dict        =		heap[smallest_child], positions[smallest_child]
								A__   ,   A__							:    Dict        =		(
								    heap[start],
								    positions[start],
								)
								A__   ,   A__							:    int        =		temp, tempa

								A__							:    str        =		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   __A			( self    ,       A__    ,       A__    ,       A__    ,       A__			):
						A__							:    Optional[int]        =		position[index]

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

							if val < heap[parent]:
								A__							:    Dict        =		heap[parent]
								A__							:    Optional[Any]        =		position[parent]
								self.set_position(position[parent]    ,       A__			)
							else:
								A__							:    Optional[int]        =		val
								A__							:    List[str]        =		temp
								self.set_position(A__    ,       A__			)
								break
							A__							:    Union[str, Any]        =		parent
						else:
							A__							:    Any        =		val
							A__							:    Optional[int]        =		temp
							self.set_position(A__    ,       0			)






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






					def   __A			( self    ,       A__    ,       A__			):
						A__							:    int        =		positions[0]
						A__							:    List[Any]        =		sys.maxsize
						self.top_to_bottom(A__    ,       0    ,       len(A__			)    ,       A__			)
						return temp



def 						UpperCamelCase					(lowercase_: int					)     ->      int:
	A__							:    Optional[Any]        =		Heap()

	A__							:    int        =		[0] * len(lowercase_					)
	A__							:    Any        =		[-1] * len(lowercase_					)  # Neighboring Tree Vertex of selected vertex
	# Minimum Distance of explored vertex with neighboring vertex of partial tree
	# formed in graph
	A__							:    Union[str, Any]        =		[]  # Heap of Distance of vertices from their neighboring vertex
	A__							:    Dict        =		[]

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

	A__							:    Tuple        =		[]
	A__							:    Optional[Any]        =		1
	A__							:    Any        =		sys.maxsize
	for neighbor, distance in adjacency_list[0]:
		A__							:    Optional[int]        =		0
		A__							:    Dict        =		distance
	heap.heapify(lowercase_    ,      lowercase_					)

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


if __name__ == "__main__":  # pragma: no cover
	# < --------- Prims Algorithm --------- >
	A_       : Optional[int]         =			int(input('Enter number of edges: ').strip())
	A_       : Any         =			defaultdict(list)
	for _ in range(edges_number):
		A_       : Union[str, 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))






from ...configuration_utils import PretrainedConfig
from ...utils import logging


A_       : int         =			logging.get_logger(__name__)

A_       : Optional[Any]         =			{
    'alibaba-damo/mgp-str-base': 'https://huggingface.co/alibaba-damo/mgp-str-base/resolve/main/config.json',
}



class     _a						(__magic_name__				):


					'''simple docstring'''






					UpperCAmelCase__:   List[Any]  							=       '''mgp-str'''






					def __init__( self    ,       A__=[32, 128]    ,       A__=4    ,       A__=3    ,       A__=27    ,       A__=38    ,       A__=5_0257    ,       A__=3_0522    ,       A__=768    ,       A__=12    ,       A__=12    ,       A__=4.0    ,       A__=True    ,       A__=False    ,       A__=1e-5    ,       A__=0.0    ,       A__=0.0    ,       A__=0.0    ,       A__=False    ,       A__=0.0_2    ,       **A__    ,       ):
						super().__init__(**A__			)

						A__							:    Dict        =		image_size
						A__							:    int        =		patch_size
						A__							:    Dict        =		num_channels
						A__							:    List[Any]        =		max_token_length
						A__							:    str        =		num_character_labels
						A__							:    Tuple        =		num_bpe_labels
						A__							:    Optional[Any]        =		num_wordpiece_labels
						A__							:    Optional[int]        =		hidden_size
						A__							:    Tuple        =		num_hidden_layers
						A__							:    Any        =		num_attention_heads
						A__							:    List[Any]        =		mlp_ratio
						A__							:    Tuple        =		distilled
						A__							:    Union[str, Any]        =		layer_norm_eps
						A__							:    Tuple        =		drop_rate
						A__							:    List[str]        =		qkv_bias
						A__							:    Optional[Any]        =		attn_drop_rate
						A__							:    Union[str, Any]        =		drop_path_rate
						A__							:    Optional[Any]        =		output_aa_attentions
						A__							:    Optional[int]        =		initializer_range



