




from typing import Dict, List, Optional, Tuple

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


a_      						=   logging.get_logger(__name__)

class        _lowerCamelCase  (	_SCREAMING_SNAKE_CASE      ):

      """simple docstring"""

      lowerCAmelCase__	:       List[Any]			=    ["input_ids", "attention_mask"]







      def __init__(   self    :       int       ,				snake_case    :       Union[str, Any]="[PAD]"       ,				snake_case    :       int="[BOS]"       ,				snake_case    :       int="[EOS]"       ,				snake_case    :       str="[MASK]"       ,				snake_case    :       Dict="[CLS]"       ,				snake_case    :       Any="[SEP]"       ,				snake_case    :       Optional[Any]=2048       ,				**snake_case    :       Union[str, Any]       ,				):
          __UpperCamelCase     						=  AddedToken(snake_case       ,				lstrip=snake_case       ,				rstrip=snake_case ) if isinstance(snake_case       ,				snake_case ) else pad_token
          __UpperCamelCase     						=  AddedToken(snake_case       ,				lstrip=snake_case       ,				rstrip=snake_case ) if isinstance(snake_case       ,				snake_case ) else bos_token
          __UpperCamelCase     						=  AddedToken(snake_case       ,				lstrip=snake_case       ,				rstrip=snake_case ) if isinstance(snake_case       ,				snake_case ) else eos_token
          __UpperCamelCase     						=  AddedToken(snake_case       ,				lstrip=snake_case       ,				rstrip=snake_case ) if isinstance(snake_case       ,				snake_case ) else mask_token
          __UpperCamelCase     						=  AddedToken(snake_case       ,				lstrip=snake_case       ,				rstrip=snake_case ) if isinstance(snake_case       ,				snake_case ) else cls_token
          __UpperCamelCase     						=  AddedToken(snake_case       ,				lstrip=snake_case       ,				rstrip=snake_case ) if isinstance(snake_case       ,				snake_case ) else sep_token

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

          __UpperCamelCase     						=  2**8  # utf is 8 bits

          # define special tokens dict
          __UpperCamelCase     						=  {
              self.pad_token: 0,
              self.bos_token: 1,
              self.eos_token: 2,
              self.mask_token: 3,
              self.cls_token: 4,
              self.sep_token: 5,
          }
          __UpperCamelCase     						=  len(self.special_tokens_encoder )
          __UpperCamelCase     						=  {v: k for k, v in self.special_tokens_encoder.items()}







      def 					snake_case		(   self    :       Optional[Any] ):
          __UpperCamelCase     						=  self.special_tokens_encoder.copy()
          vocab.update(self.added_tokens_encoder )
          for i in range(self._utf_vocab_size ):
              __UpperCamelCase     						=  chr(snake_case )
              __UpperCamelCase     						=  i + len(self.special_tokens_encoder )
          return vocab







      @property
      def 					snake_case		(   self    :       List[str] ):
          return self._utf_vocab_size + self._num_special_tokens







      def 					snake_case		(   self    :       Tuple       ,				snake_case    :       List[int]       ,				snake_case    :       Optional[List[int]] = None       ,				snake_case    :       bool = False ):
          if already_has_special_tokens:
              return super().get_special_tokens_mask(
                  token_ids_a=snake_case       ,				token_ids_a=snake_case       ,				already_has_special_tokens=snake_case )

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







      def 					snake_case		(   self    :       Dict       ,				snake_case    :       List[int]       ,				snake_case    :       Optional[List[int]] = None ):
          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 					snake_case		(   self    :       Optional[Any]       ,				snake_case    :       str ):
          __UpperCamelCase     						=  [chr(snake_case ) for i in text.encode('''utf-8''' )]
          return tokens







      def 					snake_case		(   self    :       Dict       ,				snake_case    :       str ):
          if token in self.special_tokens_encoder:
              __UpperCamelCase     						=  self.special_tokens_encoder[token]
          elif token in self.added_tokens_encoder:
              __UpperCamelCase     						=  self.added_tokens_encoder[token]
          elif len(snake_case ) != 1:
              __UpperCamelCase     						=  self.unk_token_id
          else:
              __UpperCamelCase     						=  ord(snake_case ) + self._num_special_tokens
          return token_id







      def 					snake_case		(   self    :       str       ,				snake_case    :       Dict ):
          if index in self.special_tokens_decoder:
              __UpperCamelCase     						=  self.special_tokens_decoder[index]
          elif index in self.added_tokens_decoder:
              __UpperCamelCase     						=  self.added_tokens_decoder[index]
          else:
              __UpperCamelCase     						=  chr(index - self._num_special_tokens )
          return token







      def 					snake_case		(   self    :       Tuple       ,				snake_case    :       Optional[Any] ):
          __UpperCamelCase     						=  B''''''
          for token in tokens:
              if token in self.special_tokens_decoder:
                  __UpperCamelCase     						=  self.special_tokens_decoder[token].encode('''utf-8''' )
              elif token in self.added_tokens_decoder:
                  __UpperCamelCase     						=  self.special_tokens_decoder[token].encode('''utf-8''' )
              elif token in self.special_tokens_encoder:
                  __UpperCamelCase     						=  token.encode('''utf-8''' )
              elif token in self.added_tokens_encoder:
                  __UpperCamelCase     						=  token.encode('''utf-8''' )
              else:
                  __UpperCamelCase     						=  bytes([ord(snake_case )] )
              bstring += tok_string
          __UpperCamelCase     						=  bstring.decode('''utf-8'''       ,				errors='''replace''' )
          return string







      def 					snake_case		(   self    :       int       ,				snake_case    :       str       ,				snake_case    :       Optional[str] = None ):
          return ()













"""simple docstring"""
__UpperCamelCase			:		Tuple		    =   10**8

def 						_SCREAMING_SNAKE_CASE       (_UpperCAmelCase :  int       ):
 if n % 10 == 0:
  return False
 lowerCAmelCase  							=      str(_UpperCAmelCase       )
 return s == s[::-1]

def 						_SCREAMING_SNAKE_CASE       ():
 lowerCAmelCase  							=      set()
 lowerCAmelCase  							=      1
 lowerCAmelCase  							=      5
 while sum_squares < LIMIT:
  lowerCAmelCase  							=      first_square + 1
  while sum_squares < LIMIT:
   if is_palindrome(_UpperCAmelCase       ):
    answer.add(_UpperCAmelCase       )
   last_square += 1
   sum_squares += last_square**2
  first_square += 1
  lowerCAmelCase  							=      first_square**2 + (first_square + 1) ** 2

 return sum(_UpperCAmelCase       )


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





