
'''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


lowercase	:      List[Any]				=       logging.get_logger(__name__)

lowercase	:      Optional[Any]				=       {'''vocab_file''': '''vocab.txt''', '''tokenizer_file''': '''tokenizer.json'''}

lowercase	:      Dict				=       {
    '''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''',
    },
}

lowercase	:      Tuple				=       {
    '''microsoft/mpnet-base''': 512,
}

lowercase	:      int				=       {
    '''microsoft/mpnet-base''': {'''do_lower_case''': True},
}

class   SCREAMING_SNAKE_CASE_		(       lowerCamelCase_				):
 __snake_case	:     Optional[Any]			   =      VOCAB_FILES_NAMES
 __snake_case	:     str			   =      PRETRAINED_VOCAB_FILES_MAP
 __snake_case	:     str			   =      PRETRAINED_INIT_CONFIGURATION
 __snake_case	:     str			   =      PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
 __snake_case	:     str			   =      MPNetTokenizer
 __snake_case	:     Dict			   =      ["input_ids", "attention_mask"]



 def __init__(  self   ,		A=None   ,		A=None   ,		A=True   ,		A="<s>"   ,		A="</s>"   ,		A="</s>"   ,		A="<s>"   ,		A="[UNK]"   ,		A="<pad>"   ,		A="<mask>"   ,		A=True   ,		A=None   ,		**A   ,		):






        '''simple docstring'''




        super().__init__(
            A   ,		tokenizer_file=A   ,		do_lower_case=A   ,		bos_token=A   ,		eos_token=A   ,		sep_token=A   ,		cls_token=A   ,		unk_token=A   ,		pad_token=A   ,		mask_token=A   ,		tokenize_chinese_chars=A   ,		strip_accents=A   ,		**A   ,		)

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

        lowercase  :		str						=      do_lower_case



 @property
 def    SCREAMING_SNAKE_CASE(  self ):






        '''simple docstring'''




        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    SCREAMING_SNAKE_CASE(  self   ,		A ):






        '''simple docstring'''




        lowercase  :		Any						=      AddedToken(A   ,		lstrip=A   ,		rstrip=A ) if isinstance(A   ,		A ) else value
        lowercase  :		List[str]						=      value



 def    SCREAMING_SNAKE_CASE(  self   ,		A   ,		A=None ):






        '''simple docstring'''




        lowercase  :		List[str]						=      [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    SCREAMING_SNAKE_CASE(  self   ,		A   ,		A = None ):






        '''simple docstring'''




        lowercase  :		List[Any]						=      [self.sep_token_id]
        lowercase  :		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    SCREAMING_SNAKE_CASE(  self   ,		A   ,		A = None ):






        '''simple docstring'''




        lowercase  :		List[str]						=      self._tokenizer.model.save(A   ,		name=A )
        return tuple(A )










'''simple docstring'''






def 		a_( lowerCamelCase   ,				lowerCamelCase      )				->list[tuple[int, int, int]]:






       '''simple docstring'''




       lowercase  :		Dict						=      sorted(lowerCamelCase   ,				key=lambda lowerCamelCase      : edge[2]      )

       lowercase  :		str						=      list(range(lowerCamelCase      )      )

       def find_parent(lowerCamelCase      ):
              if i != parent[i]:
                     lowercase  :		Optional[int]						=      find_parent(parent[i]      )
              return parent[i]

       lowercase  :		Union[str, Any]						=      0
       lowercase  :		Any						=      []

       for edge in edges:
              lowercase  :		Optional[Any]						=      find_parent(edge[0]      )
              lowercase  :		Any						=      find_parent(edge[1]      )
              if parent_a != parent_b:
                     minimum_spanning_tree_cost += edge[2]
                     minimum_spanning_tree.append(lowerCamelCase      )
                     lowercase  :		Optional[int]						=      parent_b

       return minimum_spanning_tree


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

      for _ in range(num_edges):
            lowercase	,	lowercase	,	lowercase	:      Optional[Any]				=       (int(x) for x in input().strip().split())
            edges.append((nodea, nodea, cost))

      kruskal(num_nodes, edges)




