
"""simple docstring"""




from __future__ import annotations

from collections import Counter

def   UpperCamelCase_  (		SCREAMING_SNAKE_CASE_      ):
     SCREAMING_SNAKE_CASE           =     [True] * n
     SCREAMING_SNAKE_CASE           =     False
     SCREAMING_SNAKE_CASE           =     False
     SCREAMING_SNAKE_CASE           =     True

     for i in range(3,					int(n**0.5 + 1      ),					2      ):
          SCREAMING_SNAKE_CASE           =     i * 2
          while index < n:
               SCREAMING_SNAKE_CASE           =     False
               SCREAMING_SNAKE_CASE           =     index + i

     SCREAMING_SNAKE_CASE           =     [2]

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

     return primes

def   UpperCamelCase_  (		SCREAMING_SNAKE_CASE_      ):
     SCREAMING_SNAKE_CASE           =     str(A_      )
     SCREAMING_SNAKE_CASE           =     []
     SCREAMING_SNAKE_CASE           =     ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]

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

     return replacements

def   UpperCamelCase_  (		SCREAMING_SNAKE_CASE_ = 8      ):
     SCREAMING_SNAKE_CASE           =     set()

     # Filter primes with less than 3 replaceable digits
     SCREAMING_SNAKE_CASE           =     {
         x for x in set(prime_sieve(1_0_0_0_0_0_0      )      ) if len(str(A_      )      ) - len(set(str(A_      )      )      ) >= 3
     }

     for prime in primes:
          if prime in numbers_checked:
               continue

          SCREAMING_SNAKE_CASE           =     digit_replacements(A_      )

          for family in replacements:
               numbers_checked.update(A_      )
               SCREAMING_SNAKE_CASE           =     primes.intersection(A_      )

               if len(A_      ) != family_length:
                    continue

               return min(A_      )

     return -1


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


"""simple docstring"""




import abc
import copy
import dataclasses
from dataclasses import dataclass
from typing import ClassVar, Dict, Type, TypeVar

from ..features import Features


snake_case			       =		TypeVar('T', bound='TaskTemplate')




@dataclass(frozen=__magic_name__				)
class 					UpperCamelCase     (	abc.ABC				):

				"""simple docstring"""



				UpperCAmelCase_    :				str
				UpperCAmelCase_    :				ClassVar[Features]
				UpperCAmelCase_    :				ClassVar[Features]


				def 							A (    self		,     lowercase__      )   ->   T:
									"""simple docstring"""







									return copy.deepcopy(self      )


				@property
				def 							A (    self      )   ->   Features:
									"""simple docstring"""







									return Features(**self.input_schema		,     **self.label_schema      )


				@property
				@abc.abstractmethod
				def 							A (    self      )   ->   Dict[str, str]:
									"""simple docstring"""







									raise NotImplementedError




				@classmethod
				def 							A (    cls		,     lowercase__      )   ->   T:
									"""simple docstring"""







									SCREAMING_SNAKE_CASE           =     {f.name for f in dataclasses.fields(cls      )}
									return cls(**{k: v for k, v in template_dict.items() if k in field_names}      )
