
"""simple docstring"""







import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils import AddedToken
from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_mpnet import MPNetTokenizer


lowerCamelCase__     =						logging.get_logger(__name__)

lowerCamelCase__     =						{"""vocab_file""": """vocab.txt""", """tokenizer_file""": """tokenizer.json"""}

lowerCamelCase__     =						{
    """vocab_file""": {
        """microsoft/mpnet-base""": """https://huggingface.co/microsoft/mpnet-base/resolve/main/vocab.txt""",
    },
    """tokenizer_file""": {
        """microsoft/mpnet-base""": """https://huggingface.co/microsoft/mpnet-base/resolve/main/tokenizer.json""",
    },
}

lowerCamelCase__     =						{
    """microsoft/mpnet-base""": 512,
}

lowerCamelCase__     =						{
    """microsoft/mpnet-base""": {"""do_lower_case""": True},
}




class 					A__			(      _lowerCamelCase):
		A_		:			str							  =      VOCAB_FILES_NAMES
		A_		:			str							  =      PRETRAINED_VOCAB_FILES_MAP
		A_		:			Union[str, Any]							  =      PRETRAINED_INIT_CONFIGURATION
		A_		:			Dict							  =      PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
		A_		:			Optional[int]							  =      MPNetTokenizer
		A_		:			str							  =      ['input_ids', 'attention_mask']

		def __init__( self			,						_SCREAMING_SNAKE_CASE=None			,						_SCREAMING_SNAKE_CASE=None			,						_SCREAMING_SNAKE_CASE=True			,						_SCREAMING_SNAKE_CASE="<s>"			,						_SCREAMING_SNAKE_CASE="</s>"			,						_SCREAMING_SNAKE_CASE="</s>"			,						_SCREAMING_SNAKE_CASE="<s>"			,						_SCREAMING_SNAKE_CASE="[UNK]"			,						_SCREAMING_SNAKE_CASE="<pad>"			,						_SCREAMING_SNAKE_CASE="<mask>"			,						_SCREAMING_SNAKE_CASE=True			,						_SCREAMING_SNAKE_CASE=None			,						**_SCREAMING_SNAKE_CASE			,						):
			super().__init__(
			    _SCREAMING_SNAKE_CASE			,						tokenizer_file=_SCREAMING_SNAKE_CASE			,						do_lower_case=_SCREAMING_SNAKE_CASE			,						bos_token=_SCREAMING_SNAKE_CASE			,						eos_token=_SCREAMING_SNAKE_CASE			,						sep_token=_SCREAMING_SNAKE_CASE			,						cls_token=_SCREAMING_SNAKE_CASE			,						unk_token=_SCREAMING_SNAKE_CASE			,						pad_token=_SCREAMING_SNAKE_CASE			,						mask_token=_SCREAMING_SNAKE_CASE			,						tokenize_chinese_chars=_SCREAMING_SNAKE_CASE			,						strip_accents=_SCREAMING_SNAKE_CASE			,						**_SCREAMING_SNAKE_CASE			,						)

			__lowerCAmelCase     :		List[str]		     = json.loads(self.backend_tokenizer.normalizer.__getstate__()					)
			if (
			    pre_tok_state.get('lowercase'			,						_SCREAMING_SNAKE_CASE					) != do_lower_case
			    or pre_tok_state.get('strip_accents'			,						_SCREAMING_SNAKE_CASE					) != strip_accents
			):
				__lowerCAmelCase     :		List[Any]		     = getattr(_SCREAMING_SNAKE_CASE			,						pre_tok_state.pop('type'					)					)
				__lowerCAmelCase     :		str		     = do_lower_case
				__lowerCAmelCase     :		Optional[Any]		     = strip_accents
				__lowerCAmelCase     :		List[str]		     = pre_tok_class(**_SCREAMING_SNAKE_CASE					)

			__lowerCAmelCase     :		Optional[Any]		     = do_lower_case

		@property
		def 				__lowerCamelCase				( self					):
			if self._mask_token is None:
				if self.verbose:
					logger.error('Using mask_token, but it is not set yet.'					)
				return None
			return str(self._mask_token					)

		@mask_token.setter
		def 				__lowerCamelCase				( self			,						_SCREAMING_SNAKE_CASE					):
			__lowerCAmelCase     :		Optional[int]		     = AddedToken(_SCREAMING_SNAKE_CASE			,						lstrip=_SCREAMING_SNAKE_CASE			,						rstrip=_SCREAMING_SNAKE_CASE					) if isinstance(_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE					) else value
			__lowerCAmelCase     :		List[Any]		     = value

		def 				__lowerCamelCase				( self			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE=None					):
			__lowerCAmelCase     :		Any		     = [self.bos_token_id] + token_ids_a + [self.eos_token_id]
			if token_ids_a is None:
				return output

			return output + [self.eos_token_id] + token_ids_a + [self.eos_token_id]

		def 				__lowerCamelCase				( self			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE = None					):
			__lowerCAmelCase     :		int		     = [self.sep_token_id]
			__lowerCAmelCase     :		Union[str, Any]		     = [self.cls_token_id]

			if token_ids_a is None:
				return len(cls + token_ids_a + sep					) * [0]
			return len(cls + token_ids_a + sep + sep + token_ids_a + sep					) * [0]







		def 				__lowerCamelCase				( self			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE = None					):
			__lowerCAmelCase     :		Union[str, Any]		     = self._tokenizer.model.save(_SCREAMING_SNAKE_CASE			,						name=_SCREAMING_SNAKE_CASE					)
			return tuple(_SCREAMING_SNAKE_CASE					)

"""simple docstring"""







def        __lowerCAmelCase							(_UpperCamelCase			,    _UpperCamelCase						):
	__lowerCAmelCase     :		Any		     = sorted(_UpperCamelCase			,    key=lambda _UpperCamelCase						: edge[2]						)

	__lowerCAmelCase     :		Union[str, Any]		     = list(range(_UpperCamelCase						)						)

	def find_parent(_UpperCamelCase						):
		if i != parent[i]:
			__lowerCAmelCase     :		int		     = find_parent(parent[i]						)
		return parent[i]

	__lowerCAmelCase     :		Optional[Any]		     = 0
	__lowerCAmelCase     :		List[str]		     = []

	for edge in edges:
		__lowerCAmelCase     :		List[str]		     = find_parent(edge[0]						)
		__lowerCAmelCase     :		Optional[Any]		     = find_parent(edge[1]						)
		if parent_a != parent_b:
			minimum_spanning_tree_cost += edge[2]
			minimum_spanning_tree.append(_UpperCamelCase						)
			__lowerCAmelCase     :		Optional[Any]		     = parent_b

	return minimum_spanning_tree


if __name__ == "__main__":  # pragma: no cover
							lowerCamelCase__   ,		lowerCamelCase__     =						list(map(int, input().strip().split()))
							lowerCamelCase__     =						[]

							for _ in range(num_edges):
														lowerCamelCase__   ,		lowerCamelCase__   ,		lowerCamelCase__     =						(int(x) for x in input().strip().split())
														edges.append((nodea, nodea, cost))

							kruskal(num_nodes, edges)