




from typing import Optional, Union

from ...file_utils import TensorType
from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, TruncationStrategy






class 			A			(		__SCREAMING_SNAKE_CASE		):
     """simple docstring"""

     _snake_case:	int     ="MarkupLMFeatureExtractor"
     _snake_case:	List[Any]     =("MarkupLMTokenizer", "MarkupLMTokenizerFast")
     _snake_case:	Tuple     =True




     def __call__(    self  :   int	,  A__  :   Tuple=None	,  A__  :   Optional[Any]=None	,  A__  :   Optional[Any]=None	,  A__  :   List[Any]=None	,  A__  :   str=None	,  A__  :   bool = True	,  A__  :   Union[bool, str, PaddingStrategy] = False	,  A__  :   Union[bool, str, TruncationStrategy] = None	,  A__  :   Optional[int] = None	,  A__  :   int = 0	,  A__  :   Optional[int] = None	,  A__  :   Optional[bool] = None	,  A__  :   Optional[bool] = None	,  A__  :   bool = False	,  A__  :   bool = False	,  A__  :   bool = False	,  A__  :   bool = False	,  A__  :   bool = True	,  A__  :   Optional[Union[str, TensorType]] = None	,  **A__  :   List[Any]	,  )				->       BatchEncoding:







           if self.parse_html:
                 if html_strings is None:
                       raise ValueError('Make sure to pass HTML strings in case `parse_html` is set to `True`'			)

                 if nodes is not None or xpaths is not None or node_labels is not None:
                       raise ValueError(
                           'Please don\'t pass nodes, xpaths nor node labels in case `parse_html` is set to `True`'			)

                 lowerCamelCase__        =				self.feature_extractor(UpperCamelCase__			)
                 lowerCamelCase__        =				features['''nodes''']
                 lowerCamelCase__        =				features['''xpaths''']
           else:
                 if html_strings is not None:
                       raise ValueError('You have passed HTML strings but `parse_html` is set to `False`.'			)
                 if nodes is None or xpaths is None:
                       raise ValueError('Make sure to pass nodes and xpaths in case `parse_html` is set to `False`'			)

        # # second, apply the tokenizer
           if questions is not None and self.parse_html:
                 if isinstance(UpperCamelCase__	,  UpperCamelCase__			):
                       lowerCamelCase__        =				[questions]  # add batch dimension (as the feature extractor always adds a batch dimension)

           lowerCamelCase__        =				self.tokenizer(
               text=questions if questions is not None else nodes	,  text_pair=nodes if questions is not None else None	,  xpaths=UpperCamelCase__	,  node_labels=UpperCamelCase__	,  add_special_tokens=UpperCamelCase__	,  padding=UpperCamelCase__	,  truncation=UpperCamelCase__	,  max_length=UpperCamelCase__	,  stride=UpperCamelCase__	,  pad_to_multiple_of=UpperCamelCase__	,  return_token_type_ids=UpperCamelCase__	,  return_attention_mask=UpperCamelCase__	,  return_overflowing_tokens=UpperCamelCase__	,  return_special_tokens_mask=UpperCamelCase__	,  return_offsets_mapping=UpperCamelCase__	,  return_length=UpperCamelCase__	,  verbose=UpperCamelCase__	,  return_tensors=UpperCamelCase__	,  **UpperCamelCase__	,  )

           return encoded_inputs




     def  __snake_case   (    self  :   Union[str, Any]	,  *A__  :   List[str]	,  **A__  :   List[Any]			)				->       int:
           return self.tokenizer.batch_decode(*UpperCamelCase__	,  **UpperCamelCase__			)




     def  __snake_case   (    self  :   Dict	,  *A__  :   int	,  **A__  :   Union[str, Any]			)				->       Optional[int]:
           return self.tokenizer.decode(*UpperCamelCase__	,  **UpperCamelCase__			)




     @property
     def  __snake_case   (    self  :   Optional[int]			)				->       List[Any]:
           lowerCamelCase__        =				self.tokenizer.model_input_names
           return tokenizer_input_names





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


      '''simple docstring'''




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

      lowerCamelCase__        =				list(range(lowerCamelCase						)						)

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

      lowerCamelCase__        =				0
      lowerCamelCase__        =				[]

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

      return minimum_spanning_tree


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

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

      kruskal(num_nodes, edges)