


'''simple docstring'''



from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxSeqaSeqConfigWithPast
from ...utils import logging


A__		: Dict												=  logging.get_logger(__name__)

A__		: Dict												=  {
    """google/long-t5-local-base""": """https://huggingface.co/google/long-t5-local-base/blob/main/config.json""",
    """google/long-t5-local-large""": """https://huggingface.co/google/long-t5-local-large/blob/main/config.json""",
    """google/long-t5-tglobal-base""": """https://huggingface.co/google/long-t5-tglobal-base/blob/main/config.json""",
    """google/long-t5-tglobal-large""": """https://huggingface.co/google/long-t5-tglobal-large/blob/main/config.json""",
}





class        UpperCAmelCase_  (_UpperCAmelCase  ):





    """simple docstring"""






    lowerCamelCase  : Any												=      'longt5'
    lowerCamelCase  : Any												=      ['past_key_values']
    lowerCamelCase  : Optional[Any]												=      {'hidden_size': 'd_model', 'num_attention_heads': 'num_heads', 'num_hidden_layers': 'num_layers'}







    def __init__(							self      ,					SCREAMING_SNAKE_CASE_=3_21_28      ,					SCREAMING_SNAKE_CASE_=5_12      ,					SCREAMING_SNAKE_CASE_=64      ,					SCREAMING_SNAKE_CASE_=20_48      ,					SCREAMING_SNAKE_CASE_=6      ,					SCREAMING_SNAKE_CASE_=None      ,					SCREAMING_SNAKE_CASE_=8      ,					SCREAMING_SNAKE_CASE_=1_27      ,					SCREAMING_SNAKE_CASE_=16      ,					SCREAMING_SNAKE_CASE_=32      ,					SCREAMING_SNAKE_CASE_=1_28      ,					SCREAMING_SNAKE_CASE_=0.1      ,					SCREAMING_SNAKE_CASE_=1E-6      ,					SCREAMING_SNAKE_CASE_=1.0      ,					SCREAMING_SNAKE_CASE_="relu"      ,					SCREAMING_SNAKE_CASE_=True      ,					SCREAMING_SNAKE_CASE_="local"      ,					SCREAMING_SNAKE_CASE_=True      ,					SCREAMING_SNAKE_CASE_=0      ,					SCREAMING_SNAKE_CASE_=1      ,					**SCREAMING_SNAKE_CASE_      ,					)    ->					List[str]:
         __lowerCamelCase       :     str        =		vocab_size
         __lowerCamelCase       :     int        =		d_model
         __lowerCamelCase       :     Any        =		d_kv
         __lowerCamelCase       :     Union[str, Any]        =		d_ff
         __lowerCamelCase       :     Dict        =		num_layers
         # default = symmetry
         __lowerCamelCase       :     int        =		num_decoder_layers if num_decoder_layers is not None else self.num_layers
         __lowerCamelCase       :     List[str]        =		num_heads
         __lowerCamelCase       :     List[Any]        =		local_radius
         __lowerCamelCase       :     Dict        =		global_block_size
         __lowerCamelCase       :     List[str]        =		relative_attention_num_buckets
         __lowerCamelCase       :     Optional[Any]        =		relative_attention_max_distance
         __lowerCamelCase       :     Optional[int]        =		dropout_rate
         __lowerCamelCase       :     List[Any]        =		layer_norm_epsilon
         __lowerCamelCase       :     Union[str, Any]        =		initializer_factor
         __lowerCamelCase       :     int        =		feed_forward_proj
         __lowerCamelCase       :     List[str]        =		encoder_attention_type
         __lowerCamelCase       :     List[Any]        =		use_cache

         __lowerCamelCase       :     List[str]        =		self.feed_forward_proj.split('-'     )
         __lowerCamelCase       :     List[Any]        =		act_info[-1]
         __lowerCamelCase       :     Dict        =		act_info[0] == 'gated'

         if len(SCREAMING_SNAKE_CASE_     ) > 1 and act_info[0] != "gated" or len(SCREAMING_SNAKE_CASE_     ) > 2:
              raise ValueError(
                  f'`feed_forward_proj`: {feed_forward_proj} is not a valid activation function of the dense layer.'
                  'Please make sure `feed_forward_proj` is of the format `gated-{ACT_FN}` or `{ACT_FN}`, e.g. '
                  '\'gated-gelu\' or \'relu\''     )

         # for backwards compatibility
         if feed_forward_proj == "gated-gelu":
              __lowerCamelCase       :     Any        =		'gelu_new'

         super().__init__(
             pad_token_id=SCREAMING_SNAKE_CASE_      ,					eos_token_id=SCREAMING_SNAKE_CASE_      ,					is_encoder_decoder=SCREAMING_SNAKE_CASE_      ,					**SCREAMING_SNAKE_CASE_      ,					)







class        UpperCAmelCase_  (_UpperCAmelCase  ):





    """simple docstring"""






    @property
    def 				lowercase_    (							self     )    ->					Mapping[str, Mapping[int, str]]:
         __lowerCamelCase       :     Dict        =		{
             'input_ids': {0: 'batch', 1: 'encoder_sequence'},
             'attention_mask': {0: 'batch', 1: 'encoder_sequence'},
         }
         if self.use_past:
              __lowerCamelCase       :     str        =		'past_encoder_sequence + sequence'
              __lowerCamelCase       :     Union[str, Any]        =		{0: 'batch'}
              __lowerCamelCase       :     List[str]        =		{0: 'batch', 1: 'past_decoder_sequence + sequence'}
         else:
              __lowerCamelCase       :     str        =		{0: 'batch', 1: 'decoder_sequence'}
              __lowerCamelCase       :     Union[str, Any]        =		{0: 'batch', 1: 'decoder_sequence'}

         if self.use_past:
              self.fill_with_past_key_values_(SCREAMING_SNAKE_CASE_      ,					direction='inputs'     )

         return common_inputs







    @property
    def 				lowercase_    (							self     )    ->					int:
         return 13










'''simple docstring'''



import math
from itertools import permutations



def       UpperCAmelCase__ (     UpperCAmelCase_   :    int							)					->		bool:

     if 1 < number < 4:
          # 2 and 3 are primes
          return True
     elif number < 2 or number % 2 == 0 or number % 3 == 0:
          # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
          return False

     # All primes number are in format of 6k +/- 1
     for i in range(5				,   int(math.sqrt(UpperCAmelCase_							) + 1							)				,   6							):
          if number % i == 0 or number % (i + 2) == 0:
               return False
     return True



def       UpperCAmelCase__ (     UpperCAmelCase_   :    int				,   UpperCAmelCase_   :    list							)					->		bool:
     __lowerCamelCase    ,	__lowerCamelCase       :     str        =		0, len(UpperCAmelCase_							) - 1
     while left <= right:
          __lowerCamelCase       :     Optional[Any]        =		(left + right) // 2
          if prime_list[middle] == target:
               return True
          elif prime_list[middle] < target:
               __lowerCamelCase       :     Union[str, Any]        =		middle + 1
          else:
               __lowerCamelCase       :     Union[str, Any]        =		middle - 1

     return False



def       UpperCAmelCase__ (     )					->		List[str]:
     __lowerCamelCase       :     Tuple        =		[n for n in range(10_01				,   1_00_00				,   2							) if is_prime(UpperCAmelCase_							)]
     __lowerCamelCase       :     Any        =		[]

     for number in prime_list:
          __lowerCamelCase       :     Optional[int]        =		[]

          for prime_member in permutations(list(str(UpperCAmelCase_							)							)							):
               __lowerCamelCase       :     int        =		int(''.join(UpperCAmelCase_							)							)

               if prime % 2 == 0:
                    continue

               if search(UpperCAmelCase_				,   UpperCAmelCase_							):
                    tmp_numbers.append(UpperCAmelCase_							)

          tmp_numbers.sort()
          if len(UpperCAmelCase_							) >= 3:
               candidates.append(UpperCAmelCase_							)

     __lowerCamelCase       :     int        =		[]
     for candidate in candidates:
          __lowerCamelCase       :     Union[str, Any]        =		len(UpperCAmelCase_							)
          __lowerCamelCase       :     Optional[Any]        =		False

          for i in range(UpperCAmelCase_							):
               for j in range(i + 1				,   UpperCAmelCase_							):
                    for k in range(j + 1				,   UpperCAmelCase_							):
                         if (
                             abs(candidate[i] - candidate[j]							)
                             == abs(candidate[j] - candidate[k]							)
                             and len({candidate[i], candidate[j], candidate[k]}							) == 3
                         ):
                              passed.append(
                                  sorted([candidate[i], candidate[j], candidate[k]]							)							)
                              __lowerCamelCase       :     List[str]        =		True

                         if found:
                              break
                    if found:
                         break
               if found:
                    break

     __lowerCamelCase       :     List[Any]        =		set()
     for seq in passed:
          answer.add(''.join([str(UpperCAmelCase_							) for i in seq]							)							)

     return max(int(UpperCAmelCase_							) for x in answer							)


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






