


'''simple docstring'''






import json
from typing import Dict, List, Optional, Tuple, Union

from tokenizers import pre_tokenizers, processors

from ...tokenization_utils_base import AddedToken, BatchEncoding, EncodedInput
from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import PaddingStrategy, logging
from .tokenization_led import LEDTokenizer


a_					:    Union[str, Any]          =    logging.get_logger(__name__)


a_					:    Union[str, Any]          =    {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"}

a_					:    Optional[int]          =    {
    "vocab_file": {
        "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/vocab.json",
    },
    "merges_file": {
        "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/merges.txt",
    },
    "tokenizer_file": {
        "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/tokenizer.json",
    },
}

a_					:    List[Any]          =    {
    "allenai/led-base-16384": 1_6_3_8_4,
}




class  a     (     _SCREAMING_SNAKE_CASE       ):
 _lowerCAmelCase 					=	VOCAB_FILES_NAMES
 _lowerCAmelCase 					=	PRETRAINED_VOCAB_FILES_MAP
 _lowerCAmelCase 					=	PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
 _lowerCAmelCase 					=	LEDTokenizer
 _lowerCAmelCase 					=	["""input_ids""", """attention_mask"""]
 def __init__( self      ,				__magic_name__=None      ,				__magic_name__=None      ,				__magic_name__=None      ,				__magic_name__="replace"      ,				__magic_name__="<s>"      ,				__magic_name__="</s>"      ,				__magic_name__="</s>"      ,				__magic_name__="<s>"      ,				__magic_name__="<unk>"      ,				__magic_name__="<pad>"      ,				__magic_name__="<mask>"      ,				__magic_name__=False      ,				__magic_name__=True      ,				**__magic_name__      ,				)					->							int:
      super().__init__(
          __magic_name__      ,				__magic_name__      ,				tokenizer_file=__magic_name__      ,				errors=__magic_name__      ,				bos_token=__magic_name__      ,				eos_token=__magic_name__      ,				sep_token=__magic_name__      ,				cls_token=__magic_name__      ,				unk_token=__magic_name__      ,				pad_token=__magic_name__      ,				mask_token=__magic_name__      ,				add_prefix_space=__magic_name__      ,				trim_offsets=__magic_name__      ,				**__magic_name__      ,				)

      _a			      =							json.loads(self.backend_tokenizer.pre_tokenizer.__getstate__()						)
      if pre_tok_state.get('add_prefix_space'      ,				__magic_name__						) != add_prefix_space:
           _a			      =							getattr(__magic_name__      ,				pre_tok_state.pop('type'						)						)
           _a			      =							add_prefix_space
           _a			      =							pre_tok_class(**__magic_name__						)

      _a			      =							add_prefix_space

      # the pre_tokenizer is already updated in the GPT2TokenizerFast `__init__`
      _a			      =							'post_processor'
      _a			      =							getattr(self.backend_tokenizer      ,				__magic_name__      ,				__magic_name__						)
      if tokenizer_component_instance:
           _a			      =							json.loads(tokenizer_component_instance.__getstate__()						)

           # The lists 'sep' and 'cls' must be cased in tuples for the object `post_processor_class`
           if "sep" in state:
                _a			      =							tuple(state['sep']						)
           if "cls" in state:
                _a			      =							tuple(state['cls']						)

           _a			      =							False

           if state.get('add_prefix_space'      ,				__magic_name__						) != add_prefix_space:
                _a			      =							add_prefix_space
                _a			      =							True

           if state.get('trim_offsets'      ,				__magic_name__						) != trim_offsets:
                _a			      =							trim_offsets
                _a			      =							True

           if changes_to_apply:
                _a			      =							getattr(__magic_name__      ,				state.pop('type'						)						)
                _a			      =							component_class(**__magic_name__						)
                setattr(self.backend_tokenizer      ,				__magic_name__      ,				__magic_name__						)
 @property
 # Copied from transformers.models.bart.tokenization_bart_fast.BartTokenizerFast.mask_token with BART->LED
 def 							__UpperCAmelCase		( self						)					->							str:
      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 							__UpperCAmelCase		( self      ,				__magic_name__						)					->							int:
      _a			      =							AddedToken(__magic_name__      ,				lstrip=__magic_name__      ,				rstrip=__magic_name__						) if isinstance(__magic_name__      ,				__magic_name__						) else value
      _a			      =							value
 def 							__UpperCAmelCase		( self      ,				*__magic_name__      ,				**__magic_name__						)					->							BatchEncoding:
      _a			      =							kwargs.get('is_split_into_words'      ,				__magic_name__						)

      if is_split_into_words and not self.add_prefix_space:
           raise ValueError(
               f'You need to instantiate {self.__class__.__name__} with add_prefix_space=True '
               'to use it with pretokenized inputs.'						)

      return super()._batch_encode_plus(*__magic_name__      ,				**__magic_name__						)
 def 							__UpperCAmelCase		( self      ,				*__magic_name__      ,				**__magic_name__						)					->							BatchEncoding:
      _a			      =							kwargs.get('is_split_into_words'      ,				__magic_name__						)

      if is_split_into_words and not self.add_prefix_space:
           raise ValueError(
               f'You need to instantiate {self.__class__.__name__} with add_prefix_space=True '
               'to use it with pretokenized inputs.'						)

      return super()._encode_plus(*__magic_name__      ,				**__magic_name__						)
 def 							__UpperCAmelCase		( self      ,				__magic_name__      ,				__magic_name__ = None						)					->							Tuple[str]:
      _a			      =							self._tokenizer.model.save(__magic_name__      ,				name=__magic_name__						)
      return tuple(__magic_name__						)
 def 							__UpperCAmelCase		( self      ,				__magic_name__      ,				__magic_name__=None						)					->							Optional[Any]:
      _a			      =							[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 							__UpperCAmelCase		( self      ,				__magic_name__      ,				__magic_name__ = None						)					->							List[int]:
      _a			      =							[self.sep_token_id]
      _a			      =							[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 							__UpperCAmelCase		( self      ,				__magic_name__      ,				__magic_name__ = None      ,				__magic_name__ = PaddingStrategy.DO_NOT_PAD      ,				__magic_name__ = None      ,				__magic_name__ = None      ,				)					->							dict:
      _a			      =							super()._pad(
          encoded_inputs=__magic_name__      ,				max_length=__magic_name__      ,				padding_strategy=__magic_name__      ,				pad_to_multiple_of=__magic_name__      ,				return_attention_mask=__magic_name__      ,				)

      # Load from model defaults
      if return_attention_mask is None:
           _a			      =							'attention_mask' in self.model_input_names

      if return_attention_mask and "global_attention_mask" in encoded_inputs:
           _a			      =							encoded_inputs[self.model_input_names[0]]
           # `global_attention_mask` need to have the same length as other (sequential) inputs.
           _a			      =							len(encoded_inputs['global_attention_mask']						) != len(__magic_name__						)

           if needs_to_be_padded:
                _a			      =							len(__magic_name__						) - len(encoded_inputs['global_attention_mask']						)

                if self.padding_side == "right":
                     # Use `-1` since `0` in `global_attention_mask` means `local attention` instead of `not to attend`
                     _a			      =							(
                         encoded_inputs['global_attention_mask'] + [-1] * difference
                     )
                elif self.padding_side == "left":
                     _a			      =							[-1] * difference + encoded_inputs[
                         'global_attention_mask'
                     ]
                else:
                     raise ValueError('Invalid padding strategy:' + str(self.padding_side						)						)

      return encoded_inputs





'''simple docstring'''






from functools import reduce

a_					:    Any          =    (
    "73167176531330624919225119674426574742355349194934"
    "96983520312774506326239578318016984801869478851843"
    "85861560789112949495459501737958331952853208805511"
    "12540698747158523863050715693290963295227443043557"
    "66896648950445244523161731856403098711121722383113"
    "62229893423380308135336276614282806444486645238749"
    "30358907296290491560440772390713810515859307960866"
    "70172427121883998797908792274921901699720888093776"
    "65727333001053367881220235421809751254540594752243"
    "52584907711670556013604839586446706324415722155397"
    "53697817977846174064955149290862569321978468622482"
    "83972241375657056057490261407972968652414535100474"
    "82166370484403199890008895243450658541227588666881"
    "16427171479924442928230863465674813919123162824586"
    "17866458359124566529476545682848912883142607690042"
    "24219022671055626321111109370544217506941658960408"
    "07198403850962455444362981230987879927244284909188"
    "84580156166097919133875499200524063689912560717606"
    "05886116467109405077541002256983155200055935729725"
    "71636269561882670428252483600823257530420752963450"
)






def 	_A				(lowerCAmelCase__  :str = N		)   ->  int:




     '''simple docstring'''



     return max(
         # mypy cannot properly interpret reduce
         int(reduce(lambda lowerCAmelCase__				,						lowerCAmelCase__		: str(int(lowerCAmelCase__		) * int(lowerCAmelCase__		)		)				,						n[i : i + 13]		)		)
         for i in range(len(lowerCAmelCase__		) - 12		)		)


if __name__ == "__main__":
 print(f'''{solution() = }''')

