

import math
from itertools import permutations

def      a__	(						UpperCAmelCase				:     int     )    ->		int:


  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      a__	(						UpperCAmelCase				:     int							,					UpperCAmelCase				:     list     )    ->		str:
  UpperCAmelCase			:				Any										=					0, len(_lowerCamelCase     ) - 1
  while left <= right:
    UpperCAmelCase			:				Tuple										=					(left + right) // 2
    if prime_list[middle] == target:
      return True
    elif prime_list[middle] < target:
      UpperCAmelCase			:				str										=					middle + 1
    else:
      UpperCAmelCase			:				Any										=					middle - 1

  return False

def      a__	(						)    ->		Any:
  UpperCAmelCase			:				int										=					[n for n in range(1_001							,					10_000							,					2     ) if is_prime(_lowerCamelCase     )]
  UpperCAmelCase			:				Optional[int]										=					[]

  for number in prime_list:
    UpperCAmelCase			:				Dict										=					[]

    for prime_member in permutations(list(str(_lowerCamelCase     )     )     ):
      UpperCAmelCase			:				Tuple										=					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			:				Any										=					[]
  for candidate in candidates:
    UpperCAmelCase			:				List[str]										=					len(_lowerCamelCase     )
    UpperCAmelCase			:				List[str]										=					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			:				Tuple										=					True

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

  UpperCAmelCase			:				List[str]										=					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 __future__ import annotations

from enum import Enum, unique
from typing import TypeVar

# Create a generic variable that can be 'Enum', or any subclass.
__lowercase							:List[Any]							=	TypeVar("T", bound="Enum")



@unique
class  _a  (					lowercase__				):






							"""simple docstring"""

							snake_case_							=    80
							snake_case_							=    70
							snake_case_							=    60
							snake_case_							=    50
							snake_case_							=    40
							snake_case_							=    30
							snake_case_							=    20
							snake_case_							=    10







@unique
class  _a  (					lowercase__				):






							"""simple docstring"""

							snake_case_							=    24
							snake_case_							=    21
							snake_case_							=    18
							snake_case_							=    15
							snake_case_							=    12
							snake_case_							=    9
							snake_case_							=    6
							snake_case_							=    3
							snake_case_							=    2
							snake_case_							=    1
							snake_case_							=    -1
							snake_case_							=    -2
							snake_case_							=    -3
							snake_case_							=    -6
							snake_case_							=    -9
							snake_case_							=    -12
							snake_case_							=    -15
							snake_case_							=    -18
							snake_case_							=    -21
							snake_case_							=    -24

							@classmethod
							def   A_	(   cls					:  type[T]     )						->dict:
													return {unit.name: unit.value for unit in cls if unit.value > 0}






							@classmethod
							def   A_	(   cls					:  type[T]     )						->dict:
													return {unit.name: unit.value for unit in cls if unit.value < 0}







def    UpperCAmelCase				(  _lowerCamelCase   :	float  ):





						'''simple docstring'''


						SCREAMING_SNAKE_CASE__  :					str =       SIUnit.get_positive() if value > 0 else SIUnit.get_negative()
						for name_prefix, value_prefix in prefixes.items():
												SCREAMING_SNAKE_CASE__  :					str =       value / (10**value_prefix)
												if numerical_part > 1:
																		return f"""{numerical_part!s} {name_prefix}"""
						return str(_lowerCamelCase  )







def    UpperCAmelCase				(  _lowerCamelCase   :	float  ):





						'''simple docstring'''


						for prefix in BinaryUnit:
												SCREAMING_SNAKE_CASE__  :					List[Any] =       value / (2**prefix.value)
												if numerical_part > 1:
																		return f"""{numerical_part!s} {prefix.name}"""
						return str(_lowerCamelCase  )


if __name__ == "__main__":
				import doctest

				doctest.testmod()