




from __future__ import annotations

from collections import Counter

def   A   (   _SCREAMING_SNAKE_CASE					)			->				list[int]:
							lowerCamelCase     :   str    				=      [True] * n
							lowerCamelCase     :   Union[str, Any]    				=      False
							lowerCamelCase     :   List[str]    				=      False
							lowerCamelCase     :   Dict    				=      True

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

							lowerCamelCase     :   List[Any]    				=      [2]

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

							return primes

def   A   (   _SCREAMING_SNAKE_CASE					)			->				list[list[int]]:
							lowerCamelCase     :   Tuple    				=      str(_SCREAMING_SNAKE_CASE					)
							lowerCamelCase     :   str    				=      []
							lowerCamelCase     :   int    				=      ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]

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

							return replacements

def   A   (   _SCREAMING_SNAKE_CASE = 8					)			->				int:
							lowerCamelCase     :   int    				=      set()

							# Filter primes with less than 3 replaceable digits
							lowerCamelCase     :   str    				=      {
							    x for x in set(prime_sieve(100_0000					)					) if len(str(_SCREAMING_SNAKE_CASE					)					) - len(set(str(_SCREAMING_SNAKE_CASE					)					)					) >= 3
							}

							for prime in primes:
														if prime in numbers_checked:
																					continue

														lowerCamelCase     :   int    				=      digit_replacements(_SCREAMING_SNAKE_CASE					)

														for family in replacements:
																					numbers_checked.update(_SCREAMING_SNAKE_CASE					)
																					lowerCamelCase     :   List[Any]    				=      primes.intersection(_SCREAMING_SNAKE_CASE					)

																					if len(_SCREAMING_SNAKE_CASE					) != family_length:
																												continue

																					return min(_SCREAMING_SNAKE_CASE					)

							return -1


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












from __future__ import annotations

def   A   (   _SCREAMING_SNAKE_CASE					)			->				list[int]:
       assert (
           isinstance(_SCREAMING_SNAKE_CASE				,_SCREAMING_SNAKE_CASE					) and mask > 0
       ), f'''mask needs to be positive integer, your input {mask}'''
       lowerCamelCase     :   str    				=      []
       lowerCamelCase     :   Any    				=      mask

       while submask:
              all_submasks.append(_SCREAMING_SNAKE_CASE					)
              lowerCamelCase     :   Union[str, Any]    				=      (submask - 1) & mask

       return all_submasks


if __name__ == "__main__":
       import doctest

       doctest.testmod()






