




import math
from itertools import permutations


def 						lowercase		(     _lowerCAmelCase      ):




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


def 						lowercase		(     _lowerCAmelCase   ,     _lowerCAmelCase      ):
  UpperCAmelCase__						,					UpperCAmelCase__    						=   0, len(lowerCamelCase__      ) - 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 						lowercase		(     ):
  UpperCAmelCase__    						=   [n for n in range(1001   ,     1_0000   ,     2      ) if is_prime(lowerCamelCase__      )]
  UpperCAmelCase__    						=   []

  for number in prime_list:
    UpperCAmelCase__    						=   []

    for prime_member in permutations(list(str(lowerCamelCase__      )      )      ):
      UpperCAmelCase__    						=   int("""""".join(lowerCamelCase__      )      )

      if prime % 2 == 0:
        continue

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

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

  UpperCAmelCase__    						=   []
  for candidate in candidates:
    UpperCAmelCase__    						=   len(lowerCamelCase__      )
    UpperCAmelCase__    						=   False

    for i in range(lowerCamelCase__      ):
      for j in range(i + 1   ,     lowerCamelCase__      ):
        for k in range(j + 1   ,     lowerCamelCase__      ):
          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(lowerCamelCase__      ) for i in seq]      )      )

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


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










from typing import TYPE_CHECKING

from ...utils import _LazyModule


snake_case__ :						List[str]     =			{'''tokenization_phobert''': ['''PhobertTokenizer''']}


if TYPE_CHECKING:
   from .tokenization_phobert import PhobertTokenizer

else:
   import sys

   snake_case__ :						Tuple     =			_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)




