

from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


_SCREAMING_SNAKE_CASE							 =			{
    '''configuration_mpnet''': ['''MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''MPNetConfig'''],
    '''tokenization_mpnet''': ['''MPNetTokenizer'''],
}

try:
      if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      _SCREAMING_SNAKE_CASE							 =			['''MPNetTokenizerFast''']

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      _SCREAMING_SNAKE_CASE							 =			[
          '''MPNET_PRETRAINED_MODEL_ARCHIVE_LIST''',
          '''MPNetForMaskedLM''',
          '''MPNetForMultipleChoice''',
          '''MPNetForQuestionAnswering''',
          '''MPNetForSequenceClassification''',
          '''MPNetForTokenClassification''',
          '''MPNetLayer''',
          '''MPNetModel''',
          '''MPNetPreTrainedModel''',
      ]

try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      _SCREAMING_SNAKE_CASE							 =			[
          '''TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST''',
          '''TFMPNetEmbeddings''',
          '''TFMPNetForMaskedLM''',
          '''TFMPNetForMultipleChoice''',
          '''TFMPNetForQuestionAnswering''',
          '''TFMPNetForSequenceClassification''',
          '''TFMPNetForTokenClassification''',
          '''TFMPNetMainLayer''',
          '''TFMPNetModel''',
          '''TFMPNetPreTrainedModel''',
      ]


if TYPE_CHECKING:
      from .configuration_mpnet import MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP, MPNetConfig
      from .tokenization_mpnet import MPNetTokenizer

      try:
            if not is_tokenizers_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_mpnet_fast import MPNetTokenizerFast

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_mpnet import (
                MPNET_PRETRAINED_MODEL_ARCHIVE_LIST,
                MPNetForMaskedLM,
                MPNetForMultipleChoice,
                MPNetForQuestionAnswering,
                MPNetForSequenceClassification,
                MPNetForTokenClassification,
                MPNetLayer,
                MPNetModel,
                MPNetPreTrainedModel,
            )

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_mpnet import (
                TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST,
                TFMPNetEmbeddings,
                TFMPNetForMaskedLM,
                TFMPNetForMultipleChoice,
                TFMPNetForQuestionAnswering,
                TFMPNetForSequenceClassification,
                TFMPNetForTokenClassification,
                TFMPNetMainLayer,
                TFMPNetModel,
                TFMPNetPreTrainedModel,
            )

else:
      import sys

      _SCREAMING_SNAKE_CASE							 =			_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)







"""simple docstring"""

import math
from itertools import permutations






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






def 				A		(							snake_case :int							,   snake_case :list						) ->      bool:
 __UpperCamelCase    ,      __UpperCamelCase							    =			0, len(snake_case						) - 1
 while left <= right:
  __UpperCamelCase							    =			(left + right) // 2
  if prime_list[middle] == target:
   return True
  elif prime_list[middle] < target:
   __UpperCamelCase							    =			middle + 1
  else:
   __UpperCamelCase							    =			middle - 1

 return False






def 				A		(							) ->      int:
 __UpperCamelCase							    =			[n for n in range(1_0_0_1							,   1_0_0_0_0							,   2						) if is_prime(snake_case						)]
 __UpperCamelCase							    =			[]

 for number in prime_list:
  __UpperCamelCase							    =			[]

  for prime_member in permutations(list(str(snake_case						)						)						):
   __UpperCamelCase							    =			int(''.join(snake_case						)						)

   if prime % 2 == 0:
    continue

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

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

 __UpperCamelCase							    =			[]
 for candidate in candidates:
  __UpperCamelCase							    =			len(snake_case						)
  __UpperCamelCase							    =			False

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

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

 __UpperCamelCase							    =			set()
 for seq in passed:
  answer.add(''.join([str(snake_case						) for i in seq]						)						)

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


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



