




from typing import Dict, List, Optional, Tuple

from ...tokenization_utils import AddedToken, PreTrainedTokenizer
from ...utils import logging


UpperCAmelCase__						:       Optional[Any]							=    logging.get_logger(__name__)

class      UpperCAmelCase						(			A   ):
   __SCREAMING_SNAKE_CASE		:							List[str]							=					["input_ids", "attention_mask"]






   def __init__(	self   :       Union[str, Any]						,					UpperCamelCase_   :       int="[PAD]"						,					UpperCamelCase_   :       List[Any]="[BOS]"						,					UpperCamelCase_   :       Optional[int]="[EOS]"						,					UpperCamelCase_   :       Optional[Any]="[MASK]"						,					UpperCamelCase_   :       Optional[Any]="[CLS]"						,					UpperCamelCase_   :       Optional[Any]="[SEP]"						,					UpperCamelCase_   :       List[str]=20_48						,					**UpperCamelCase_   :       Union[str, Any]						,					)->			None:
     _lowercase: int						     =    AddedToken(UpperCamelCase_						,					lstrip=UpperCamelCase_						,					rstrip=UpperCamelCase_     ) if isinstance(UpperCamelCase_						,					UpperCamelCase_     ) else pad_token
     _lowercase: List[Any]						     =    AddedToken(UpperCamelCase_						,					lstrip=UpperCamelCase_						,					rstrip=UpperCamelCase_     ) if isinstance(UpperCamelCase_						,					UpperCamelCase_     ) else bos_token
     _lowercase: str						     =    AddedToken(UpperCamelCase_						,					lstrip=UpperCamelCase_						,					rstrip=UpperCamelCase_     ) if isinstance(UpperCamelCase_						,					UpperCamelCase_     ) else eos_token
     _lowercase: Union[str, Any]						     =    AddedToken(UpperCamelCase_						,					lstrip=UpperCamelCase_						,					rstrip=UpperCamelCase_     ) if isinstance(UpperCamelCase_						,					UpperCamelCase_     ) else mask_token
     _lowercase: Dict						     =    AddedToken(UpperCamelCase_						,					lstrip=UpperCamelCase_						,					rstrip=UpperCamelCase_     ) if isinstance(UpperCamelCase_						,					UpperCamelCase_     ) else cls_token
     _lowercase: Dict						     =    AddedToken(UpperCamelCase_						,					lstrip=UpperCamelCase_						,					rstrip=UpperCamelCase_     ) if isinstance(UpperCamelCase_						,					UpperCamelCase_     ) else sep_token

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

     _lowercase: Optional[Any]						     =    2**8  # utf is 8 bits

     # define special tokens dict
     _lowercase: Dict[str, int]						     =    {
         self.pad_token: 0,
         self.bos_token: 1,
         self.eos_token: 2,
         self.mask_token: 3,
         self.cls_token: 4,
         self.sep_token: 5,
     }
     _lowercase: Optional[Any]						     =    len(self.special_tokens_encoder     )
     _lowercase: Dict[int, str]						     =    {v: k for k, v in self.special_tokens_encoder.items()}






   def  _a						(	self   :       str     )->			Dict[str, int]:
     _lowercase: Dict						     =    self.special_tokens_encoder.copy()
     vocab.update(self.added_tokens_encoder     )
     for i in range(self._utf_vocab_size     ):
       _lowercase: Union[str, Any]						     =    chr(UpperCamelCase_     )
       _lowercase: List[Any]						     =    i + len(self.special_tokens_encoder     )
     return vocab






   @property
   def  _a						(	self   :       List[str]     )->			Dict:
     return self._utf_vocab_size + self._num_special_tokens






   def  _a						(	self   :       List[str]						,					UpperCamelCase_   :       List[int]						,					UpperCamelCase_   :       Optional[List[int]] = None						,					UpperCamelCase_   :       bool = False     )->			List[int]:
     if already_has_special_tokens:
       return super().get_special_tokens_mask(
           token_ids_a=UpperCamelCase_						,					token_ids_a=UpperCamelCase_						,					already_has_special_tokens=UpperCamelCase_     )

     # normal case: some special tokens
     if token_ids_a is None:
       return [1] + [0] * len(UpperCamelCase_     ) + [1]
     return [1] + ([0] * len(UpperCamelCase_     )) + [1] + ([0] * len(UpperCamelCase_     )) + [1]






   def  _a						(	self   :       Any						,					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]
     else:
       return [self.cls_token_id] + token_ids_a + [self.sep_token_id] + token_ids_a + [self.sep_token_id]






   def  _a						(	self   :       str						,					UpperCamelCase_   :       str     )->			List[str]:
     _lowercase: Dict						     =    [chr(UpperCamelCase_     ) for i in text.encode('utf-8'     )]
     return tokens






   def  _a						(	self   :       Tuple						,					UpperCamelCase_   :       Any     )->			List[str]:
     if token in self.special_tokens_encoder:
       _lowercase: Optional[Any]						     =    self.special_tokens_encoder[token]
     elif token in self.added_tokens_encoder:
       _lowercase: Dict						     =    self.added_tokens_encoder[token]
     elif len(UpperCamelCase_     ) != 1:
       _lowercase: str						     =    self.unk_token_id
     else:
       _lowercase: List[Any]						     =    ord(UpperCamelCase_     ) + self._num_special_tokens
     return token_id






   def  _a						(	self   :       Tuple						,					UpperCamelCase_   :       Optional[Any]     )->			Dict:
     if index in self.special_tokens_decoder:
       _lowercase: Optional[Any]						     =    self.special_tokens_decoder[index]
     elif index in self.added_tokens_decoder:
       _lowercase: Optional[Any]						     =    self.added_tokens_decoder[index]
     else:
       _lowercase: Optional[Any]						     =    chr(index - self._num_special_tokens     )
     return token






   def  _a						(	self   :       Any						,					UpperCamelCase_   :       List[str]     )->			Optional[Any]:
     _lowercase: List[Any]						     =    b''
     for token in tokens:
       if token in self.special_tokens_decoder:
         _lowercase: Optional[int]						     =    self.special_tokens_decoder[token].encode('utf-8'     )
       elif token in self.added_tokens_decoder:
         _lowercase: List[str]						     =    self.special_tokens_decoder[token].encode('utf-8'     )
       elif token in self.special_tokens_encoder:
         _lowercase: Any						     =    token.encode('utf-8'     )
       elif token in self.added_tokens_encoder:
         _lowercase: List[str]						     =    token.encode('utf-8'     )
       else:
         _lowercase: List[str]						     =    bytes([ord(UpperCamelCase_     )]     )
       bstring += tok_string
     _lowercase: int						     =    bstring.decode('utf-8'						,					errors='replace'     )
     return string






   def  _a						(	self   :       str						,					UpperCamelCase_   :       str						,					UpperCamelCase_   :       Optional[str] = None     )->			Tuple[str]:
     return ()






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())
