



from __future__ import annotations

from collections import Counter

def 					lowerCAmelCase__  (							_SCREAMING_SNAKE_CASE    :     int      ):
				"""simple docstring"""







				__a					       =						[True] * n
				__a					       =						False
				__a					       =						False
				__a					       =						True

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

				__a					       =						[2]

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

				return primes

def 					lowerCAmelCase__  (							_SCREAMING_SNAKE_CASE    :     int      ):
				"""simple docstring"""







				__a					       =						str(_SCREAMING_SNAKE_CASE      )
				__a					       =						[]
				__a					       =						["""0""", """1""", """2""", """3""", """4""", """5""", """6""", """7""", """8""", """9"""]

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

				return replacements

def 					lowerCAmelCase__  (							_SCREAMING_SNAKE_CASE    :     int = 8      ):
				"""simple docstring"""







				__a					       =						set()

				# Filter primes with less than 3 replaceable digits
				__a					       =						{
				    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

								__a					       =						digit_replacements(_SCREAMING_SNAKE_CASE      )

								for family in replacements:
												numbers_checked.update(_SCREAMING_SNAKE_CASE      )
												__a					       =						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 typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


lowerCamelCase__     =	{
    """configuration_oneformer""": ["""ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""", """OneFormerConfig"""],
    """processing_oneformer""": ["""OneFormerProcessor"""],
}

try:
						if not is_vision_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCamelCase__     =	["""OneFormerImageProcessor"""]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCamelCase__     =	[
						    """ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """OneFormerForUniversalSegmentation""",
						    """OneFormerModel""",
						    """OneFormerPreTrainedModel""",
						]

if TYPE_CHECKING:
						from .configuration_oneformer import ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, OneFormerConfig
						from .processing_oneformer import OneFormerProcessor

						try:
												if not is_vision_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .image_processing_oneformer import OneFormerImageProcessor
						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_oneformer import (
												    ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
												    OneFormerForUniversalSegmentation,
												    OneFormerModel,
												    OneFormerPreTrainedModel,
												)


else:
						import sys

						lowerCamelCase__     =	_LazyModule(__name__, globals()["""__file__"""], _import_structure)
