




'''simple docstring'''


import math
from typing import Optional

import numpy as np

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


_snake_case   :   Optional[Any]     							=	logging.get_logger(__name__)

_snake_case   :   List[Any]     							=	{
    'facebook/encodec_24khz': 'https://huggingface.co/facebook/encodec_24khz/resolve/main/config.json',
    'facebook/encodec_48khz': 'https://huggingface.co/facebook/encodec_48khz/resolve/main/config.json',
}

class        A					(	_a					):
							lowercase_           =       'encodec'







							def __init__(						self :						List[Any]							,    lowerCAmelCase_ :						List[str]=[1.5, 3.0, 6.0, 12.0, 24.0]							,    lowerCAmelCase_ :						Dict=2_40_00							,    lowerCAmelCase_ :						Dict=1							,    lowerCAmelCase_ :						Optional[Any]=False							,    lowerCAmelCase_ :						Optional[Any]=None							,    lowerCAmelCase_ :						List[Any]=None							,    lowerCAmelCase_ :						Union[str, Any]=1_28							,    lowerCAmelCase_ :						Any=32							,    lowerCAmelCase_ :						Any=1							,    lowerCAmelCase_ :						Union[str, Any]=[8, 5, 4, 2]							,    lowerCAmelCase_ :						Optional[int]="weight_norm"							,    lowerCAmelCase_ :						List[Any]=7							,    lowerCAmelCase_ :						Union[str, Any]=7							,    lowerCAmelCase_ :						Dict=3							,    lowerCAmelCase_ :						List[str]=2							,    lowerCAmelCase_ :						int=True							,    lowerCAmelCase_ :						Dict="reflect"							,    lowerCAmelCase_ :						int=2							,    lowerCAmelCase_ :						Union[str, Any]=2							,    lowerCAmelCase_ :						Optional[int]=1.0							,    lowerCAmelCase_ :						List[str]=10_24							,    lowerCAmelCase_ :						Dict=None							,    lowerCAmelCase_ :						int=True							,    **lowerCAmelCase_ :						int							,    )    ->							Union[str, Any]:


														"""simple docstring"""


														_a			  =       target_bandwidths
														_a			  =       sampling_rate
														_a			  =       audio_channels
														_a			  =       normalize
														_a			  =       chunk_length_s
														_a			  =       overlap
														_a			  =       hidden_size
														_a			  =       num_filters
														_a			  =       num_residual_layers
														_a			  =       upsampling_ratios
														_a			  =       norm_type
														_a			  =       kernel_size
														_a			  =       last_kernel_size
														_a			  =       residual_kernel_size
														_a			  =       dilation_growth_rate
														_a			  =       use_causal_conv
														_a			  =       pad_mode
														_a			  =       compress
														_a			  =       num_lstm_layers
														_a			  =       trim_right_ratio
														_a			  =       codebook_size
														_a			  =       codebook_dim if codebook_dim is not None else hidden_size
														_a			  =       use_conv_shortcut

														if self.norm_type not in ["weight_norm", "time_group_norm"]:
																					raise ValueError(
																					    F'self.norm_type must be one of `"weight_norm"`, `"time_group_norm"`), got {self.norm_type}'      )

														super().__init__(**lowerCAmelCase_      )







							@property
							def      __lowerCAmelCase    (						self :						Optional[Any]      )    ->							Optional[int]:


														"""simple docstring"""


														if self.chunk_length_s is None:
																					return None
														else:
																					return int(self.chunk_length_s * self.sampling_rate      )







							@property
							def      __lowerCAmelCase    (						self :						Dict      )    ->							Optional[int]:


														"""simple docstring"""


														if self.chunk_length_s is None or self.overlap is None:
																					return None
														else:
																					return max(1							,    int((1.0 - self.overlap) * self.chunk_length      )      )







							@property
							def      __lowerCAmelCase    (						self :						List[Any]      )    ->							int:


														"""simple docstring"""


														_a			  =       np.prod(self.upsampling_ratios      )
														return math.ceil(self.sampling_rate / hop_length      )







							@property
							def      __lowerCAmelCase    (						self :						List[str]      )    ->							int:


														"""simple docstring"""


														return int(10_00 * self.target_bandwidths[-1] // (self.frame_rate * 10)      )







'''simple docstring'''


import sys
from collections import defaultdict

class     A					:







							def __init__(						self :						Optional[Any]      )    ->							Union[str, Any]:


														"""simple docstring"""


														_a			  =       []







							def      __lowerCAmelCase    (						self :						Union[str, Any]							,    lowerCAmelCase_ :						List[Any]      )    ->							int:


														"""simple docstring"""


														return self.node_position[vertex]







							def      __lowerCAmelCase    (						self :						List[Any]							,    lowerCAmelCase_ :						Optional[Any]							,    lowerCAmelCase_ :						Optional[Any]      )    ->							Tuple:


														"""simple docstring"""


														_a			  =       pos







							def      __lowerCAmelCase    (						self :						Dict							,    lowerCAmelCase_ :						str							,    lowerCAmelCase_ :						Any							,    lowerCAmelCase_ :						Dict							,    lowerCAmelCase_ :						int      )    ->							Any:


														"""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]							,    lowerCAmelCase_      )

																												self.top_to_bottom(lowerCAmelCase_							,    lowerCAmelCase_							,    lowerCAmelCase_							,    lowerCAmelCase_      )







							def      __lowerCAmelCase    (						self :						Optional[int]							,    lowerCAmelCase_ :						List[str]							,    lowerCAmelCase_ :						List[Any]							,    lowerCAmelCase_ :						Any							,    lowerCAmelCase_ :						Dict      )    ->							Any:


														"""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]							,    lowerCAmelCase_      )
																					else:
																												_a			  =       val
																												_a			  =       temp
																												self.set_position(lowerCAmelCase_							,    lowerCAmelCase_      )
																												break
																					_a			  =       parent
														else:
																					_a			  =       val
																					_a			  =       temp
																					self.set_position(lowerCAmelCase_							,    0      )







							def      __lowerCAmelCase    (						self :						Any							,    lowerCAmelCase_ :						List[Any]							,    lowerCAmelCase_ :						Optional[Any]      )    ->							Optional[int]:


														"""simple docstring"""


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







							def      __lowerCAmelCase    (						self :						str							,    lowerCAmelCase_ :						str							,    lowerCAmelCase_ :						int      )    ->							List[Any]:


														"""simple docstring"""


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



def 	snake_case_					(UpperCamelCase :						Any   ):





							'''simple docstring'''


							_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 --------- >
				_snake_case   :   List[str]     							=	int(input('Enter number of edges: ').strip())
				_snake_case   :   Union[str, Any]     							=	defaultdict(list)
				for _ in range(edges_number):
								_snake_case   :   Tuple     							=	[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))

