"""simple docstring"""


import math
from itertools import permutations


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


def   __UpperCAmelCase     (	_snake_case		:       int,				_snake_case		:       list       ):
   _lowercase     ,  _lowercase							     =       0, len(_snake_case       ) - 1
   while left <= right:
      _lowercase							     =       (left + right) // 2
      if prime_list[middle] == target:
         return True
      elif prime_list[middle] < target:
         _lowercase							     =       middle + 1
      else:
         _lowercase							     =       middle - 1

   return False


def   __UpperCAmelCase     (	):
   _lowercase							     =       [n for n in range(1_0_0_1,				1_0_0_0_0,				2       ) if is_prime(_snake_case       )]
   _lowercase							     =       []

   for number in prime_list:
      _lowercase							     =       []

      for prime_member in permutations(list(str(_snake_case       )       )       ):
         _lowercase							     =       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       )

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

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

   _lowercase							     =       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())
"""simple docstring"""


from ..utils import DummyObject, requires_backends
class   UpperCAmelCase_	(				metaclass=lowercase__   ):
    snake_case_											=      ["""torch""", """transformers""", """k_diffusion"""]
    def __init__(	self			:       Optional[Any]   ,						*_lowercase			:       Optional[int]   ,						**_lowercase			:       List[str]		)						->    Dict:
       requires_backends(self   ,						["torch", "transformers", "k_diffusion"]		)
    @classmethod
    def 		_lowerCamelCase      (	cls			:       Union[str, Any]   ,						*_lowercase			:       Any   ,						**_lowercase			:       List[Any]		)						->    str:
       requires_backends(cls   ,						["torch", "transformers", "k_diffusion"]		)




    @classmethod
    def 		_lowerCamelCase      (	cls			:       Optional[Any]   ,						*_lowercase			:       List[Any]   ,						**_lowercase			:       Any		)						->    Any:
       requires_backends(cls   ,						["torch", "transformers", "k_diffusion"]		)