

"""simple docstring"""


from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


a    :str			=       logging.get_logger(__name__)

a    :Union[str, Any]			=       {
    "microsoft/swin-tiny-patch4-window7-224": (
        "https://huggingface.co/microsoft/swin-tiny-patch4-window7-224/resolve/main/config.json"
    ),
    # See all Swin models at https://huggingface.co/models?filter=swin
}

class    __a							(lowerCAmelCase__      ,		lowerCAmelCase__):






     '''simple docstring'''
     _SCREAMING_SNAKE_CASE  :Optional[int]				=       """swin"""

     _SCREAMING_SNAKE_CASE  :Any				=       {
         """num_attention_heads""": """num_heads""",
         """num_hidden_layers""": """num_layers""",
     }

     def __init__(  self		,			_a=224		,			_a=4		,			_a=3		,			_a=96		,			_a=[2, 2, 6, 2]		,			_a=[3, 6, 12, 24]		,			_a=7		,			_a=4.0		,			_a=True		,			_a=0.0		,			_a=0.0		,			_a=0.1		,			_a="gelu"		,			_a=False		,			_a=0.02		,			_a=1E-5		,			_a=32		,			_a=None		,			_a=None		,			**_a		,			)     ->					int:


           """simple docstring"""


           super().__init__(**__a     )

           SCREAMING_SNAKE_CASE__      :					int											=		image_size
           SCREAMING_SNAKE_CASE__      :					Optional[int]											=		patch_size
           SCREAMING_SNAKE_CASE__      :					List[str]											=		num_channels
           SCREAMING_SNAKE_CASE__      :					int											=		embed_dim
           SCREAMING_SNAKE_CASE__      :					Optional[int]											=		depths
           SCREAMING_SNAKE_CASE__      :					Union[str, Any]											=		len(__a     )
           SCREAMING_SNAKE_CASE__      :					Tuple											=		num_heads
           SCREAMING_SNAKE_CASE__      :					int											=		window_size
           SCREAMING_SNAKE_CASE__      :					List[Any]											=		mlp_ratio
           SCREAMING_SNAKE_CASE__      :					Optional[int]											=		qkv_bias
           SCREAMING_SNAKE_CASE__      :					List[str]											=		hidden_dropout_prob
           SCREAMING_SNAKE_CASE__      :					List[Any]											=		attention_probs_dropout_prob
           SCREAMING_SNAKE_CASE__      :					Any											=		drop_path_rate
           SCREAMING_SNAKE_CASE__      :					Dict											=		hidden_act
           SCREAMING_SNAKE_CASE__      :					List[str]											=		use_absolute_embeddings
           SCREAMING_SNAKE_CASE__      :					List[str]											=		layer_norm_eps
           SCREAMING_SNAKE_CASE__      :					List[str]											=		initializer_range
           SCREAMING_SNAKE_CASE__      :					Union[str, Any]											=		encoder_stride
           # we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
           # this indicates the channel dimension after the last stage of the model
           SCREAMING_SNAKE_CASE__      :					Dict											=		int(embed_dim * 2 ** (len(__a     ) - 1)     )
           SCREAMING_SNAKE_CASE__      :					List[str]											=		["""stem"""] + [f'''stage{idx}''' for idx in range(1		,			len(__a     ) + 1     )]
           SCREAMING_SNAKE_CASE__						,						SCREAMING_SNAKE_CASE__      :					int											=		get_aligned_output_features_output_indices(
               out_features=__a		,			out_indices=__a		,			stage_names=self.stage_names     )





class    __a							(lowerCAmelCase__):






     '''simple docstring'''
     _SCREAMING_SNAKE_CASE  :Optional[int]				=       version.parse("""1.11""")

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


           """simple docstring"""


           return OrderedDict(
               [
                   ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
               ]     )





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


           """simple docstring"""


           return 1E-4








"""simple docstring"""


import sys
from collections import defaultdict
class   _UpperCamelCase  :
							'''simple docstring'''







							def __init__(     self	):
										__lowerCAmelCase				    =			[]

							def 			snake_case				(     self    ,   __a	):
										return self.node_position[vertex]

							def 			snake_case				(     self    ,   __a    ,   __a	):
										__lowerCAmelCase				    =			pos

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

																__lowerCAmelCase				    =			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 			snake_case				(     self    ,   __a    ,   __a    ,   __a    ,   __a	):
										__lowerCAmelCase				    =			position[index]

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

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

							def 			snake_case				(     self    ,   __a    ,   __a	):
										__lowerCAmelCase				    =			len(__a	) // 2 - 1
										for i in range(__a    ,   -1    ,   -1	):
													self.top_to_bottom(__a    ,   __a    ,   len(__a	)    ,   __a	)



							def 			snake_case				(     self    ,   __a    ,   __a	):
										__lowerCAmelCase				    =			positions[0]
										__lowerCAmelCase				    =			sys.maxsize
										self.top_to_bottom(__a    ,   0    ,   len(__a	)    ,   __a	)
										return temp


def _lowerCamelCase	(		_UpperCamelCase      ):

			'''simple docstring'''




			__lowerCAmelCase				    =			Heap()

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

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

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

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


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




