
import math
from itertools import permutations




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




def 					lowerCamelCase__					(    a__	:	int						,   a__	:	list  )		->						bool:
       UpperCamelCase_							,					UpperCamelCase_											=							0, len(a__  ) - 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 					lowerCamelCase__					(    )		->						Optional[int]:
       UpperCamelCase_											=							[n for n in range(1001						,   1_0000						,   2  ) if is_prime(a__  )]
       UpperCamelCase_											=							[]

       for number in prime_list:
              UpperCamelCase_											=							[]

              for prime_member in permutations(list(str(a__  )  )  ):
                     UpperCamelCase_											=							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__  )

       UpperCamelCase_											=							[]
       for candidate in candidates:
              UpperCamelCase_											=							len(a__  )
              UpperCamelCase_											=							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]]  )  )
                                          UpperCamelCase_											=							True

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

       UpperCamelCase_											=							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())





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_A							=       {'''configuration_dinat''': ['''DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''DinatConfig''']}


try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      _A							=       [
          '''DINAT_PRETRAINED_MODEL_ARCHIVE_LIST''',
          '''DinatForImageClassification''',
          '''DinatModel''',
          '''DinatPreTrainedModel''',
          '''DinatBackbone''',
      ]

if TYPE_CHECKING:
      from .configuration_dinat import DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP, DinatConfig

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_dinat import (
                DINAT_PRETRAINED_MODEL_ARCHIVE_LIST,
                DinatBackbone,
                DinatForImageClassification,
                DinatModel,
                DinatPreTrainedModel,
            )

else:
      import sys

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



