'''simple docstring'''




import sys
from collections import defaultdict






class 		__A       :






       def __init__(      self      ):
              __UpperCAmelCase  :				Optional[Any]       				=		[]






       def 			_snake_case						(      self				,     UpperCamelCase_      ):
              return self.node_position[vertex]






       def 			_snake_case						(      self				,     UpperCamelCase_				,     UpperCamelCase_      ):
              __UpperCAmelCase  :				List[Any]       				=		pos






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

                            __UpperCAmelCase  :				Any       				=		self.get_position(positions[smallest_child]      )
                            self.set_position(
                                positions[smallest_child]				,     self.get_position(positions[start]      )      )
                            self.set_position(positions[start]				,     UpperCamelCase_      )

                            self.top_to_bottom(UpperCamelCase_				,     UpperCamelCase_				,     UpperCamelCase_				,     UpperCamelCase_      )






       def 			_snake_case						(      self				,     UpperCamelCase_				,     UpperCamelCase_				,     UpperCamelCase_				,     UpperCamelCase_      ):
              __UpperCAmelCase  :				Dict       				=		position[index]

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

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






       def 			_snake_case						(      self				,     UpperCamelCase_				,     UpperCamelCase_      ):
              __UpperCAmelCase  :				Any       				=		len(UpperCamelCase_      ) // 2 - 1
              for i in range(UpperCamelCase_				,     -1				,     -1      ):
                     self.top_to_bottom(UpperCamelCase_				,     UpperCamelCase_				,     len(UpperCamelCase_      )				,     UpperCamelCase_      )







       def 			_snake_case						(      self				,     UpperCamelCase_				,     UpperCamelCase_      ):
              __UpperCAmelCase  :				Tuple       				=		positions[0]
              __UpperCAmelCase  :				Tuple       				=		sys.maxsize
              self.top_to_bottom(UpperCamelCase_				,     0				,     len(UpperCamelCase_      )				,     UpperCamelCase_      )
              return temp





def _lowercase	(      lowerCamelCase__						)					->       str:





       """simple docstring"""


       __UpperCAmelCase  :				List[str]       				=		Heap()

       __UpperCAmelCase  :				Tuple       				=		[0] * len(lowerCamelCase__						)
       __UpperCAmelCase  :				Optional[int]       				=		[-1] * len(lowerCamelCase__						)  # Neighboring Tree Vertex of selected vertex
       # Minimum Distance of explored vertex with neighboring vertex of partial tree
       # formed in graph
       __UpperCAmelCase  :				Tuple       				=		[]  # Heap of Distance of vertices from their neighboring vertex
       __UpperCAmelCase  :				Dict       				=		[]

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

       __UpperCAmelCase  :				Dict       				=		[]
       __UpperCAmelCase  :				Dict       				=		1
       __UpperCAmelCase  :				int       				=		sys.maxsize
       for neighbor, distance in adjacency_list[0]:
              __UpperCAmelCase  :				Union[str, Any]       				=		0
              __UpperCAmelCase  :				int       				=		distance
       heap.heapify(lowerCamelCase__							,    lowerCamelCase__						)

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


if __name__ == "__main__":  # pragma: no cover
   # < --------- Prims Algorithm --------- >
   _a   :	int 							=   int(input("Enter number of edges: ").strip())
   _a   :	Tuple 							=   defaultdict(list)
   for _ in range(edges_number):
      _a   :	Dict 							=   [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))







'''simple docstring'''




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


_a   :	Any 							=   logging.get_logger(__name__)

_a   :	int 							=   {
    "facebook/s2t-wav2vec2-large-en-de": (
        "https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/config.json"
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech2text2
}






class 		__A       (__magic_name__   ):
       snake_case       :Optional[int]				    =					"speech_to_text_2"
       snake_case       :List[Any]				    =					["past_key_values"]
       snake_case       :str				    =					{"num_attention_heads": "decoder_attention_heads", "hidden_size": "d_model"}






       def __init__(      self				,     UpperCamelCase_=1_00_00				,     UpperCamelCase_=6				,     UpperCamelCase_=20_48				,     UpperCamelCase_=4				,     UpperCamelCase_=0.0				,     UpperCamelCase_=True				,     UpperCamelCase_="relu"				,     UpperCamelCase_=2_56				,     UpperCamelCase_=0.1				,     UpperCamelCase_=0.0				,     UpperCamelCase_=0.0				,     UpperCamelCase_=0.0_2				,     UpperCamelCase_=2				,     UpperCamelCase_=True				,     UpperCamelCase_=1				,     UpperCamelCase_=0				,     UpperCamelCase_=2				,     UpperCamelCase_=10_24				,     **UpperCamelCase_				,     ):
              __UpperCAmelCase  :				Any       				=		vocab_size
              __UpperCAmelCase  :				Optional[int]       				=		d_model
              __UpperCAmelCase  :				Tuple       				=		decoder_ffn_dim
              __UpperCAmelCase  :				List[str]       				=		decoder_layers
              __UpperCAmelCase  :				str       				=		decoder_attention_heads
              __UpperCAmelCase  :				Dict       				=		dropout
              __UpperCAmelCase  :				Optional[Any]       				=		attention_dropout
              __UpperCAmelCase  :				int       				=		activation_dropout
              __UpperCAmelCase  :				Dict       				=		activation_function
              __UpperCAmelCase  :				Tuple       				=		init_std
              __UpperCAmelCase  :				Any       				=		decoder_layerdrop
              __UpperCAmelCase  :				str       				=		use_cache
              __UpperCAmelCase  :				int       				=		decoder_layers
              __UpperCAmelCase  :				Any       				=		scale_embedding  # scale factor will be sqrt(d_model) if True
              __UpperCAmelCase  :				Union[str, Any]       				=		max_target_positions

              super().__init__(
                  pad_token_id=UpperCamelCase_				,     bos_token_id=UpperCamelCase_				,     eos_token_id=UpperCamelCase_				,     decoder_start_token_id=UpperCamelCase_				,     **UpperCamelCase_				,     )






