



'''simple docstring'''






from __future__ import annotations

from collections import Counter





def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     int  )		->list[int]:






							'''simple docstring'''
							_lowercase							:		str				=   [True] * n
							_lowercase							:		Union[str, Any]				=   False
							_lowercase							:		List[Any]				=   False
							_lowercase							:		List[str]				=   True

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

							_lowercase							:		Union[str, Any]				=   [2]

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

							return primes





def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     int  )		->list[list[int]]:






							'''simple docstring'''
							_lowercase							:		Any				=   str(snake_case_  )
							_lowercase							:		List[str]				=   []
							_lowercase							:		int				=   ['''0''', '''1''', '''2''', '''3''', '''4''', '''5''', '''6''', '''7''', '''8''', '''9''']

							for duplicate in Counter(snake_case_  ) - Counter(set(snake_case_  )  ):
														_lowercase							:		Union[str, Any]				=   [int(number_str.replace(snake_case_ ,       snake_case_  )  ) for digit in digits]
														replacements.append(snake_case_  )

							return replacements





def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     int = 8  )		->int:






							'''simple docstring'''
							_lowercase							:		List[Any]				=   set()

							# Filter primes with less than 3 replaceable digits
							_lowercase							:		int				=   {
							    x for x in set(prime_sieve(1_00_00_00  )  ) if len(str(snake_case_  )  ) - len(set(str(snake_case_  )  )  ) >= 3
							}

							for prime in primes:
														if prime in numbers_checked:
																					continue

														_lowercase							:		Any				=   digit_replacements(snake_case_  )

														for family in replacements:
																					numbers_checked.update(snake_case_  )
																					_lowercase							:		Optional[Any]				=   primes.intersection(snake_case_  )

																					if len(snake_case_  ) != family_length:
																												continue

																					return min(snake_case_  )

							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


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

@dataclass(frozen=__A       )
class 	_lowerCAmelCase     (    abc.ABC       ):






		'''simple docstring'''
		# `task` is not a ClassVar since we want it to be part of the `asdict` output for JSON serialization
		snake_case_							= 42
		snake_case_							= 42
		snake_case_							= 42
		def 						__lowercase      (						self							:       T      ,		UpperCamelCase_							:       Features		)      ->			T:







									'''simple docstring'''





									return copy.deepcopy(self		)
		@property
		def 						__lowercase      (						self							:       int		)      ->			Features:







									'''simple docstring'''





									return Features(**self.input_schema      ,		**self.label_schema		)
		@property
		@abc.abstractmethod
		def 						__lowercase      (						self							:       List[str]		)      ->			Dict[str, str]:







									'''simple docstring'''





									raise NotImplementedError





		@classmethod
		def 						__lowercase      (						cls							:       Type[T]      ,		UpperCamelCase_							:       dict		)      ->			T:







									'''simple docstring'''





									_lowercase							:		List[str]				=   {f.name for f in dataclasses.fields(cls		)}
									return cls(**{k: v for k, v in template_dict.items() if k in field_names}		)



