


'''simple docstring'''






from __future__ import annotations

from collections import Counter





def lowerCamelCase__			(						__lowerCamelCase       :							int							):







   '''simple docstring'''




   _UpperCAmelCase   :   List[Any]							    =[True] * n
   _UpperCAmelCase   :   Tuple							    =False
   _UpperCAmelCase   :   Dict							    =False
   _UpperCAmelCase   :   Optional[Any]							    =True

   for i in range(3       ,    int(n**0.5 + 1							)       ,    2							):
      _UpperCAmelCase   :   Union[str, Any]							    =i * 2
      while index < n:
         _UpperCAmelCase   :   List[str]							    =False
         _UpperCAmelCase   :   int							    =index + i

   _UpperCAmelCase   :   List[str]							    =[2]

   for i in range(3       ,    __lowerCamelCase       ,    2							):
      if is_prime[i]:
         primes.append(__lowerCamelCase							)

   return primes





def lowerCamelCase__			(						__lowerCamelCase       :							int							):







   '''simple docstring'''




   _UpperCAmelCase   :   Any							    =str(__lowerCamelCase							)
   _UpperCAmelCase   :   Any							    =[]
   _UpperCAmelCase   :   int							    =['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']

   for duplicate in Counter(__lowerCamelCase							) - Counter(set(__lowerCamelCase							)							):
      _UpperCAmelCase   :   Optional[int]							    =[int(number_str.replace(__lowerCamelCase       ,    __lowerCamelCase							)							) for digit in digits]
      replacements.append(__lowerCamelCase							)

   return replacements





def lowerCamelCase__			(						__lowerCamelCase       :							int = 8							):







   '''simple docstring'''




   _UpperCAmelCase   :   int							    =set()

   # Filter primes with less than 3 replaceable digits
   _UpperCAmelCase   :   Optional[Any]							    ={
       x for x in set(prime_sieve(1_0_0_0_0_0_0							)							) if len(str(__lowerCamelCase							)							) - len(set(str(__lowerCamelCase							)							)							) >= 3
   }

   for prime in primes:
      if prime in numbers_checked:
         continue

      _UpperCAmelCase   :   Tuple							    =digit_replacements(__lowerCamelCase							)

      for family in replacements:
         numbers_checked.update(__lowerCamelCase							)
         _UpperCAmelCase   :   Optional[int]							    =primes.intersection(__lowerCamelCase							)

         if len(__lowerCamelCase							) != family_length:
            continue

         return min(__lowerCamelCase							)

   return -1


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







def 	lowerCAmelCase_	(     lowerCamelCase:				int  )    ->	int:


      '''simple docstring'''




      return n * (2 * n - 1)

def 	lowerCAmelCase_	(     lowerCamelCase:				int  )    ->	bool:


      '''simple docstring'''




      lowerCamelCase__					     = (1 + 24 * n) ** 0.5
      return ((1 + root) / 6) % 1 == 0

def 	lowerCAmelCase_	(     lowerCamelCase:				int = 1_44  )    ->	int:


      '''simple docstring'''




      lowerCamelCase__					     = start
      lowerCamelCase__					     = hexagonal_num(lowerCamelCase  )
      while not is_pentagonal(lowerCamelCase  ):
            n += 1
            lowerCamelCase__					     = hexagonal_num(lowerCamelCase  )
      return num


if __name__ == "__main__":
      print(F"""{solution()} = """)