




'''simple docstring'''


import warnings
from collections import OrderedDict
from typing import Any, Mapping, Optional

from ... import PreTrainedTokenizer
from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig, OnnxConfigWithPast, OnnxSeqaSeqConfigWithPast
from ...onnx.utils import compute_effective_axis_dimension
from ...utils import TensorType, is_torch_available, logging


_lowercase  =			logging.get_logger(__name__)

_lowercase  =			{
    """facebook/bart-large""": """https://huggingface.co/facebook/bart-large/resolve/main/config.json""",
    # See all BART models at https://huggingface.co/models?filter=bart
}
class 						a_				(			_lowerCAmelCase						):
	lowercase_       :     Union[str, Any]			  =      '''bart'''
	lowercase_       :     str			  =      ['''past_key_values''']
	lowercase_       :     Tuple			  =      {'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}




	def __init__(       self     :  Dict       ,		__lowerCAmelCase     :  List[str]=5_0_2_6_5       ,		__lowerCAmelCase     :  int=1_0_2_4       ,		__lowerCAmelCase     :  Optional[Any]=1_2       ,		__lowerCAmelCase     :  List[str]=4_0_9_6       ,		__lowerCAmelCase     :  Tuple=1_6       ,		__lowerCAmelCase     :  Union[str, Any]=1_2       ,		__lowerCAmelCase     :  List[Any]=4_0_9_6       ,		__lowerCAmelCase     :  int=1_6       ,		__lowerCAmelCase     :  str=0.0       ,		__lowerCAmelCase     :  Union[str, Any]=0.0       ,		__lowerCAmelCase     :  Optional[int]="gelu"       ,		__lowerCAmelCase     :  int=1_0_2_4       ,		__lowerCAmelCase     :  str=0.1       ,		__lowerCAmelCase     :  Tuple=0.0       ,		__lowerCAmelCase     :  List[str]=0.0       ,		__lowerCAmelCase     :  Any=0.02       ,		__lowerCAmelCase     :  str=0.0       ,		__lowerCAmelCase     :  Optional[int]=False       ,		__lowerCAmelCase     :  Union[str, Any]=True       ,		__lowerCAmelCase     :  Optional[Any]=3       ,		__lowerCAmelCase     :  Dict=1       ,		__lowerCAmelCase     :  Optional[int]=0       ,		__lowerCAmelCase     :  Tuple=2       ,		__lowerCAmelCase     :  Optional[Any]=True       ,		__lowerCAmelCase     :  Optional[Any]=2       ,		__lowerCAmelCase     :  Optional[Any]=2       ,		**__lowerCAmelCase     :  Optional[Any]       ,		):
							__snake_case						 =   vocab_size
							__snake_case						 =   max_position_embeddings
							__snake_case						 =   d_model
							__snake_case						 =   encoder_ffn_dim
							__snake_case						 =   encoder_layers
							__snake_case						 =   encoder_attention_heads
							__snake_case						 =   decoder_ffn_dim
							__snake_case						 =   decoder_layers
							__snake_case						 =   decoder_attention_heads
							__snake_case						 =   dropout
							__snake_case						 =   attention_dropout
							__snake_case						 =   activation_dropout
							__snake_case						 =   activation_function
							__snake_case						 =   init_std
							__snake_case						 =   encoder_layerdrop
							__snake_case						 =   decoder_layerdrop
							__snake_case						 =   classifier_dropout
							__snake_case						 =   use_cache
							__snake_case						 =   encoder_layers
							__snake_case						 =   scale_embedding  # scale factor will be sqrt(d_model) if True

							super().__init__(
							    num_labels=__lowerCAmelCase       ,		pad_token_id=__lowerCAmelCase       ,		bos_token_id=__lowerCAmelCase       ,		eos_token_id=__lowerCAmelCase       ,		is_encoder_decoder=__lowerCAmelCase       ,		decoder_start_token_id=__lowerCAmelCase       ,		forced_eos_token_id=__lowerCAmelCase       ,		**__lowerCAmelCase       ,		)

							# ensure backward compatibility for BART CNN models
							if self.forced_bos_token_id is None and kwargs.get('force_bos_token_to_be_generated'       ,		__lowerCAmelCase      ):
													__snake_case						 =   self.bos_token_id
													warnings.warn(
													    F'Please make sure the config includes `forced_bos_token_id={self.bos_token_id}` in future versions. '
													    'The config can simply be saved and uploaded again to be fixed.'      )





class 						a_				(			_lowerCAmelCase						):




	@property
	def   lowercase__   (       self     :  Dict      ):
							if self.task in ["default", "seq2seq-lm"]:
													__snake_case						 =   OrderedDict(
													    [
													        ('input_ids', {0: 'batch', 1: 'encoder_sequence'}),
													        ('attention_mask', {0: 'batch', 1: 'encoder_sequence'}),
													    ]      )

													if self.use_past:
																			__snake_case						 =   {0: 'batch'}
																			__snake_case						 =   {0: 'batch', 1: 'past_decoder_sequence + sequence'}
													else:
																			__snake_case						 =   {0: 'batch', 1: 'decoder_sequence'}
																			__snake_case						 =   {0: 'batch', 1: 'decoder_sequence'}

													if self.use_past:
																			self.fill_with_past_key_values_(__lowerCAmelCase       ,		direction='inputs'      )
							elif self.task == "causal-lm":
													# TODO: figure this case out.
													__snake_case						 =   OrderedDict(
													    [
													        ('input_ids', {0: 'batch', 1: 'encoder_sequence'}),
													        ('attention_mask', {0: 'batch', 1: 'encoder_sequence'}),
													    ]      )
													if self.use_past:
																			__snake_case ,       __snake_case						 =   self.num_layers
																			for i in range(__lowerCAmelCase      ):
																									__snake_case						 =   {0: 'batch', 2: 'past_sequence + sequence'}
																									__snake_case						 =   {0: 'batch', 2: 'past_sequence + sequence'}
							else:
													__snake_case						 =   OrderedDict(
													    [
													        ('input_ids', {0: 'batch', 1: 'encoder_sequence'}),
													        ('attention_mask', {0: 'batch', 1: 'encoder_sequence'}),
													        ('decoder_input_ids', {0: 'batch', 1: 'decoder_sequence'}),
													        ('decoder_attention_mask', {0: 'batch', 1: 'decoder_sequence'}),
													    ]      )

							return common_inputs




	@property
	def   lowercase__   (       self     :  Any      ):
							if self.task in ["default", "seq2seq-lm"]:
													__snake_case						 =   super().outputs
							else:
													__snake_case						 =   super(__lowerCAmelCase       ,		self      ).outputs
													if self.use_past:
																			__snake_case ,       __snake_case						 =   self.num_layers
																			for i in range(__lowerCAmelCase      ):
																									__snake_case						 =   {0: 'batch', 2: 'past_sequence + sequence'}
																									__snake_case						 =   {0: 'batch', 2: 'past_sequence + sequence'}
							return common_outputs




	def   lowercase__   (       self     :  int       ,		__lowerCAmelCase     :  List[str]       ,		__lowerCAmelCase     :  int = -1       ,		__lowerCAmelCase     :  str = -1       ,		__lowerCAmelCase     :  Any = False       ,		__lowerCAmelCase     :  str = None       ,		):
							__snake_case						 =   self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
							    __lowerCAmelCase       ,		__lowerCAmelCase       ,		__lowerCAmelCase       ,		__lowerCAmelCase       ,		__lowerCAmelCase      )

							# Generate decoder inputs
							__snake_case						 =   seq_length if not self.use_past else 1
							__snake_case						 =   self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
							    __lowerCAmelCase       ,		__lowerCAmelCase       ,		__lowerCAmelCase       ,		__lowerCAmelCase       ,		__lowerCAmelCase      )
							__snake_case						 =   {F'decoder_{name}': tensor for name, tensor in decoder_inputs.items()}
							__snake_case						 =   dict(**__lowerCAmelCase       ,		**__lowerCAmelCase      )

							if self.use_past:
													if not is_torch_available():
																			raise ValueError('Cannot generate dummy past_keys inputs without PyTorch installed.'      )
													else:
																			import torch
													__snake_case ,       __snake_case						 =   common_inputs['input_ids'].shape
													__snake_case						 =   common_inputs['decoder_input_ids'].shape[1]
													__snake_case ,       __snake_case						 =   self.num_attention_heads
													__snake_case						 =   (
													    batch,
													    num_encoder_attention_heads,
													    encoder_seq_length,
													    self._config.hidden_size // num_encoder_attention_heads,
													)
													__snake_case						 =   decoder_seq_length + 3
													__snake_case						 =   (
													    batch,
													    num_decoder_attention_heads,
													    decoder_past_length,
													    self._config.hidden_size // num_decoder_attention_heads,
													)

													__snake_case						 =   torch.cat(
													    [common_inputs['decoder_attention_mask'], torch.ones(__lowerCAmelCase       ,		__lowerCAmelCase      )]       ,		dim=1      )

													__snake_case						 =   []
													# If the number of encoder and decoder layers are present in the model configuration, both are considered
													__snake_case ,       __snake_case						 =   self.num_layers
													__snake_case						 =   min(__lowerCAmelCase       ,		__lowerCAmelCase      )
													__snake_case						 =   max(__lowerCAmelCase       ,		__lowerCAmelCase      ) - min_num_layers
													__snake_case						 =   'encoder' if num_encoder_layers > num_decoder_layers else 'decoder'

													for _ in range(__lowerCAmelCase      ):
																			common_inputs["past_key_values"].append(
																			    (
																			        torch.zeros(__lowerCAmelCase      ),
																			        torch.zeros(__lowerCAmelCase      ),
																			        torch.zeros(__lowerCAmelCase      ),
																			        torch.zeros(__lowerCAmelCase      ),
																			    )      )
													# TODO: test this.
													__snake_case						 =   encoder_shape if remaining_side_name == 'encoder' else decoder_shape
													for _ in range(__lowerCAmelCase       ,		__lowerCAmelCase      ):
																			common_inputs["past_key_values"].append((torch.zeros(__lowerCAmelCase      ), torch.zeros(__lowerCAmelCase      ))      )
							return common_inputs




	def   lowercase__   (       self     :  str       ,		__lowerCAmelCase     :  int       ,		__lowerCAmelCase     :  List[Any] = -1       ,		__lowerCAmelCase     :  Any = -1       ,		__lowerCAmelCase     :  List[str] = False       ,		__lowerCAmelCase     :  Optional[int] = None       ,		):
							__snake_case						 =   self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
							    __lowerCAmelCase       ,		__lowerCAmelCase       ,		__lowerCAmelCase       ,		__lowerCAmelCase       ,		__lowerCAmelCase      )

							if self.use_past:
													if not is_torch_available():
																			raise ValueError('Cannot generate dummy past_keys inputs without PyTorch installed.'      )
													else:
																			import torch
													__snake_case ,       __snake_case						 =   common_inputs['input_ids'].shape
													# Not using the same length for past_key_values
													__snake_case						 =   seqlen + 2
													__snake_case ,       __snake_case						 =   self.num_layers
													__snake_case ,       __snake_case						 =   self.num_attention_heads
													__snake_case						 =   (
													    batch,
													    num_encoder_attention_heads,
													    past_key_values_length,
													    self._config.hidden_size // num_encoder_attention_heads,
													)

													__snake_case						 =   common_inputs['attention_mask'].dtype
													__snake_case						 =   torch.cat(
													    [common_inputs['attention_mask'], torch.ones(__lowerCAmelCase       ,		__lowerCAmelCase       ,		dtype=__lowerCAmelCase      )]       ,		dim=1      )
													__snake_case						 =   [
													    (torch.zeros(__lowerCAmelCase      ), torch.zeros(__lowerCAmelCase      )) for _ in range(__lowerCAmelCase      )
													]
							return common_inputs




	def   lowercase__   (       self     :  List[str]       ,		__lowerCAmelCase     :  Any       ,		__lowerCAmelCase     :  Optional[Any] = -1       ,		__lowerCAmelCase     :  List[Any] = -1       ,		__lowerCAmelCase     :  Optional[Any] = False       ,		__lowerCAmelCase     :  Optional[int] = None       ,		):
							__snake_case						 =   compute_effective_axis_dimension(
							    __lowerCAmelCase       ,		fixed_dimension=OnnxConfig.default_fixed_batch       ,		num_token_to_add=0      )

							# If dynamic axis (-1) we forward with a fixed dimension of 8 tokens to avoid optimizations made by ONNX
							__snake_case						 =   tokenizer.num_special_tokens_to_add(__lowerCAmelCase      )
							__snake_case						 =   compute_effective_axis_dimension(
							    __lowerCAmelCase       ,		fixed_dimension=OnnxConfig.default_fixed_sequence       ,		num_token_to_add=__lowerCAmelCase      )

							# Generate dummy inputs according to compute batch and sequence
							__snake_case						 =   [' '.join([tokenizer.unk_token]      ) * seq_length] * batch_size
							__snake_case						 =   dict(tokenizer(__lowerCAmelCase       ,		return_tensors=__lowerCAmelCase      )      )
							return common_inputs




	def   lowercase__   (       self     :  List[Any]       ,		__lowerCAmelCase     :  List[Any]       ,		__lowerCAmelCase     :  Optional[int] = -1       ,		__lowerCAmelCase     :  Optional[int] = -1       ,		__lowerCAmelCase     :  List[str] = False       ,		__lowerCAmelCase     :  Tuple = None       ,		):
							if self.task in ["default", "seq2seq-lm"]:
													__snake_case						 =   self._generate_dummy_inputs_for_default_and_seqaseq_lm(
													    __lowerCAmelCase       ,		batch_size=__lowerCAmelCase       ,		seq_length=__lowerCAmelCase       ,		is_pair=__lowerCAmelCase       ,		framework=__lowerCAmelCase      )

							elif self.task == "causal-lm":
													__snake_case						 =   self._generate_dummy_inputs_for_causal_lm(
													    __lowerCAmelCase       ,		batch_size=__lowerCAmelCase       ,		seq_length=__lowerCAmelCase       ,		is_pair=__lowerCAmelCase       ,		framework=__lowerCAmelCase      )
							else:
													__snake_case						 =   self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
													    __lowerCAmelCase       ,		batch_size=__lowerCAmelCase       ,		seq_length=__lowerCAmelCase       ,		is_pair=__lowerCAmelCase       ,		framework=__lowerCAmelCase      )

							return common_inputs




	def   lowercase__   (       self     :  Union[str, Any]       ,		__lowerCAmelCase     :  Tuple       ,		__lowerCAmelCase     :  str       ,		__lowerCAmelCase     :  Optional[int]       ,		__lowerCAmelCase     :  List[str]      ):
							if self.task in ["default", "seq2seq-lm"]:
													__snake_case						 =   super()._flatten_past_key_values_(__lowerCAmelCase       ,		__lowerCAmelCase       ,		__lowerCAmelCase       ,		__lowerCAmelCase      )
							else:
													__snake_case						 =   super(__lowerCAmelCase       ,		self      )._flatten_past_key_values_(
													    __lowerCAmelCase       ,		__lowerCAmelCase       ,		__lowerCAmelCase       ,		__lowerCAmelCase      )









'''simple docstring'''



import sys

__UpperCamelCase   :							List[str]         =   (
    """73167176531330624919225119674426574742355349194934"""
    """96983520312774506326239578318016984801869478851843"""
    """85861560789112949495459501737958331952853208805511"""
    """12540698747158523863050715693290963295227443043557"""
    """66896648950445244523161731856403098711121722383113"""
    """62229893423380308135336276614282806444486645238749"""
    """30358907296290491560440772390713810515859307960866"""
    """70172427121883998797908792274921901699720888093776"""
    """65727333001053367881220235421809751254540594752243"""
    """52584907711670556013604839586446706324415722155397"""
    """53697817977846174064955149290862569321978468622482"""
    """83972241375657056057490261407972968652414535100474"""
    """82166370484403199890008895243450658541227588666881"""
    """16427171479924442928230863465674813919123162824586"""
    """17866458359124566529476545682848912883142607690042"""
    """24219022671055626321111109370544217506941658960408"""
    """07198403850962455444362981230987879927244284909188"""
    """84580156166097919133875499200524063689912560717606"""
    """05886116467109405077541002256983155200055935729725"""
    """71636269561882670428252483600823257530420752963450"""
)



def  __UpperCAmelCase						(					SCREAMING_SNAKE_CASE__:						str = N     )	->      int:

   """simple docstring"""
   __a					  =     -sys.maxsize - 1
   for i in range(len(SCREAMING_SNAKE_CASE__     ) - 12     ):
      __a					  =     1
      for j in range(13     ):
         product *= int(n[i + j]     )
      if product > largest_product:
         __a					  =     product
   return largest_product


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