




import os
from shutil import copyfile
from typing import List, Optional, Tuple

from ...tokenization_utils import AddedToken
from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import is_sentencepiece_available, logging


if is_sentencepiece_available():
   from .tokenization_xlm_roberta import XLMRobertaTokenizer
else:
   UpperCAmelCase__						:       Dict							=    None


UpperCAmelCase__						:       Any							=    logging.get_logger(__name__)

UpperCAmelCase__						:       Optional[int]							=    {'vocab_file': 'sentencepiece.bpe.model', 'tokenizer_file': 'tokenizer.json'}

UpperCAmelCase__						:       int							=    {
    'vocab_file': {
        'xlm-roberta-base': 'https://huggingface.co/xlm-roberta-base/resolve/main/sentencepiece.bpe.model',
        'xlm-roberta-large': 'https://huggingface.co/xlm-roberta-large/resolve/main/sentencepiece.bpe.model',
        'xlm-roberta-large-finetuned-conll02-dutch': (
            'https://huggingface.co/xlm-roberta-large-finetuned-conll02-dutch/resolve/main/sentencepiece.bpe.model'
        ),
        'xlm-roberta-large-finetuned-conll02-spanish': (
            'https://huggingface.co/xlm-roberta-large-finetuned-conll02-spanish/resolve/main/sentencepiece.bpe.model'
        ),
        'xlm-roberta-large-finetuned-conll03-english': (
            'https://huggingface.co/xlm-roberta-large-finetuned-conll03-english/resolve/main/sentencepiece.bpe.model'
        ),
        'xlm-roberta-large-finetuned-conll03-german': (
            'https://huggingface.co/xlm-roberta-large-finetuned-conll03-german/resolve/main/sentencepiece.bpe.model'
        ),
    },
    'tokenizer_file': {
        'xlm-roberta-base': 'https://huggingface.co/xlm-roberta-base/resolve/main/tokenizer.json',
        'xlm-roberta-large': 'https://huggingface.co/xlm-roberta-large/resolve/main/tokenizer.json',
        'xlm-roberta-large-finetuned-conll02-dutch': (
            'https://huggingface.co/xlm-roberta-large-finetuned-conll02-dutch/resolve/main/tokenizer.json'
        ),
        'xlm-roberta-large-finetuned-conll02-spanish': (
            'https://huggingface.co/xlm-roberta-large-finetuned-conll02-spanish/resolve/main/tokenizer.json'
        ),
        'xlm-roberta-large-finetuned-conll03-english': (
            'https://huggingface.co/xlm-roberta-large-finetuned-conll03-english/resolve/main/tokenizer.json'
        ),
        'xlm-roberta-large-finetuned-conll03-german': (
            'https://huggingface.co/xlm-roberta-large-finetuned-conll03-german/resolve/main/tokenizer.json'
        ),
    },
}

UpperCAmelCase__						:       Any							=    {
    'xlm-roberta-base': 512,
    'xlm-roberta-large': 512,
    'xlm-roberta-large-finetuned-conll02-dutch': 512,
    'xlm-roberta-large-finetuned-conll02-spanish': 512,
    'xlm-roberta-large-finetuned-conll03-english': 512,
    'xlm-roberta-large-finetuned-conll03-german': 512,
}

class      UpperCAmelCase						(			A   ):
   __SCREAMING_SNAKE_CASE		:							Optional[int]							=					VOCAB_FILES_NAMES
   __SCREAMING_SNAKE_CASE		:							Union[str, Any]							=					PRETRAINED_VOCAB_FILES_MAP
   __SCREAMING_SNAKE_CASE		:							str							=					PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
   __SCREAMING_SNAKE_CASE		:							Union[str, Any]							=					["input_ids", "attention_mask"]
   __SCREAMING_SNAKE_CASE		:							Optional[int]							=					XLMRobertaTokenizer






   def __init__(	self   :       List[str]						,					UpperCamelCase_   :       Tuple=None						,					UpperCamelCase_   :       Tuple=None						,					UpperCamelCase_   :       List[str]="<s>"						,					UpperCamelCase_   :       Union[str, Any]="</s>"						,					UpperCamelCase_   :       int="</s>"						,					UpperCamelCase_   :       Any="<s>"						,					UpperCamelCase_   :       Any="<unk>"						,					UpperCamelCase_   :       int="<pad>"						,					UpperCamelCase_   :       Tuple="<mask>"						,					**UpperCamelCase_   :       Optional[Any]						,					)->			Union[str, Any]:
     # Mask token behave like a normal word, i.e. include the space before it
     _lowercase: Optional[int]						     =    AddedToken(UpperCamelCase_						,					lstrip=UpperCamelCase_						,					rstrip=UpperCamelCase_     ) if isinstance(UpperCamelCase_						,					UpperCamelCase_     ) else mask_token

     super().__init__(
         UpperCamelCase_						,					tokenizer_file=UpperCamelCase_						,					bos_token=UpperCamelCase_						,					eos_token=UpperCamelCase_						,					sep_token=UpperCamelCase_						,					cls_token=UpperCamelCase_						,					unk_token=UpperCamelCase_						,					pad_token=UpperCamelCase_						,					mask_token=UpperCamelCase_						,					**UpperCamelCase_						,					)

     _lowercase: Any						     =    vocab_file
     _lowercase: str						     =    False if not self.vocab_file else True






   def  _a						(	self   :       Dict						,					UpperCamelCase_   :       List[int]						,					UpperCamelCase_   :       Optional[List[int]] = None     )->			List[int]:

     if token_ids_a is None:
       return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
     _lowercase: str						     =    [self.cls_token_id]
     _lowercase: Optional[int]						     =    [self.sep_token_id]
     return cls + token_ids_a + sep + sep + token_ids_a + sep






   def  _a						(	self   :       Tuple						,					UpperCamelCase_   :       List[int]						,					UpperCamelCase_   :       Optional[List[int]] = None     )->			List[int]:
     _lowercase: int						     =    [self.sep_token_id]
     _lowercase: List[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  _a						(	self   :       Union[str, Any]						,					UpperCamelCase_   :       str						,					UpperCamelCase_   :       Optional[str] = None     )->			Tuple[str]:
     if not self.can_save_slow_tokenizer:
       raise ValueError(
           'Your fast tokenizer does not have the necessary information to save the vocabulary for a slow '
           'tokenizer.'     )

     if not os.path.isdir(UpperCamelCase_     ):
       logger.error(f'Vocabulary path ({save_directory}) should be a directory.'     )
       return
     _lowercase: List[str]						     =    os.path.join(
         UpperCamelCase_						,					(filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES['vocab_file']     )

     if os.path.abspath(self.vocab_file     ) != os.path.abspath(UpperCamelCase_     ):
       copyfile(self.vocab_file						,					UpperCamelCase_     )

     return (out_vocab_file,)






import math


def 		_lowerCamelCase				(					UpperCamelCase							)			->		int:





  """simple docstring"""





  return sum(int(UpperCamelCase							) for digit in str(UpperCamelCase							)							)


def 		_lowerCamelCase				(					UpperCamelCase = 30							)			->		int:





  """simple docstring"""





  _lowercase: int						     =    []
  for digit in range(2					,     100							):
    for power in range(2					,     100							):
      _lowercase: int						     =    int(math.pow(UpperCamelCase					,     UpperCamelCase							)							)
      if digit == digit_sum(UpperCamelCase							):
        digit_to_powers.append(UpperCamelCase							)

  digit_to_powers.sort()
  return digit_to_powers[n - 1]


if __name__ == "__main__":
   print(solution())
