





"""simple docstring"""
import math
from itertools import permutations




def 			__snake_case						(      __A    )		->				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(__A    ) + 1    ) ,6    ):
      if number % i == 0 or number % (i + 2) == 0:
         return False
   return True




def 			__snake_case						(      __A ,__A    )		->				bool:
   lowercase    :			Dict  =       0, len(__A    ) - 1
   while left <= right:
      lowercase    :			Any  =       (left + right) // 2
      if prime_list[middle] == target:
         return True
      elif prime_list[middle] < target:
         lowercase    :			List[str]  =       middle + 1
      else:
         lowercase    :			str  =       middle - 1

   return False




def 			__snake_case						(      )		->				List[str]:
   lowercase    :			List[str]  =       [n for n in range(1001 ,10000 ,2    ) if is_prime(__A    )]
   lowercase    :			Any  =       []

   for number in prime_list:
      lowercase    :			Any  =       []

      for prime_member in permutations(list(str(__A    )    )    ):
         lowercase    :			int  =       int("""""".join(__A    )    )

         if prime % 2 == 0:
            continue

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

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

   lowercase    :			Any  =       []
   for candidate in candidates:
      lowercase    :			Any  =       len(__A    )
      lowercase    :			Optional[Any]  =       False

      for i in range(__A    ):
         for j in range(i + 1 ,__A    ):
            for k in range(j + 1 ,__A    ):
               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]]    )    )
                  lowercase    :			Tuple  =       True

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

   lowercase    :			Dict  =       set()
   for seq in passed:
      answer.add("""""".join([str(__A    ) for i in seq]    )    )

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


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









"""simple docstring"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCAmelCase:	int							      =logging.get_logger(__name__)

lowerCAmelCase:	int							      ={
    "bert-base-uncased": "https://huggingface.co/bert-base-uncased/resolve/main/config.json",
    # QDQBERT models can be loaded from any BERT checkpoint, available at https://huggingface.co/models?filter=bert
}
class lowerCamelCase__  (    __UpperCamelCase				):
   __UpperCAmelCase        =					"""qdqbert"""



   def __init__(       self      ,   snake_case=3_0_5_2_2      ,   snake_case=7_6_8      ,   snake_case=1_2      ,   snake_case=1_2      ,   snake_case=3_0_7_2      ,   snake_case="gelu"      ,   snake_case=0.1      ,   snake_case=0.1      ,   snake_case=5_1_2      ,   snake_case=2      ,   snake_case=0.02      ,   snake_case=1E-12      ,   snake_case=True      ,   snake_case=1      ,   snake_case=0      ,   snake_case=2      ,   **snake_case      ,   ) ->    List[str]:







      """simple docstring"""
      super().__init__(pad_token_id=snake_case      ,   bos_token_id=snake_case      ,   eos_token_id=snake_case      ,   **snake_case	)

      lowercase    :			Optional[Any]  =       vocab_size
      lowercase    :			int  =       max_position_embeddings
      lowercase    :			Dict  =       hidden_size
      lowercase    :			Union[str, Any]  =       num_hidden_layers
      lowercase    :			str  =       num_attention_heads
      lowercase    :			List[str]  =       intermediate_size
      lowercase    :			List[str]  =       hidden_act
      lowercase    :			List[str]  =       hidden_dropout_prob
      lowercase    :			Optional[Any]  =       attention_probs_dropout_prob
      lowercase    :			Optional[Any]  =       initializer_range
      lowercase    :			str  =       type_vocab_size
      lowercase    :			Optional[int]  =       layer_norm_eps
      lowercase    :			Optional[int]  =       use_cache


