


'''simple docstring'''




from __future__ import annotations

from collections import Counter

def       __UpperCamelCase     (     _A     :					int					)     ->   list[int]:




	"""simple docstring"""





	lowerCAmelCase       :     str   				=			[True] * n
	lowerCAmelCase       :     str   				=			False
	lowerCAmelCase       :     Union[str, Any]   				=			False
	lowerCAmelCase       :     Optional[Any]   				=			True

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

	lowerCAmelCase       :     Dict   				=			[2]

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

	return primes

def       __UpperCamelCase     (     _A     :					int					)     ->   list[list[int]]:




	"""simple docstring"""





	lowerCAmelCase       :     Union[str, Any]   				=			str(_A					)
	lowerCAmelCase       :     Union[str, Any]   				=			[]
	lowerCAmelCase       :     Dict   				=			['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']

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

	return replacements

def       __UpperCamelCase     (     _A     :					int = 8					)     ->   int:




	"""simple docstring"""





	lowerCAmelCase       :     Dict   				=			set()

	# Filter primes with less than 3 replaceable digits
	lowerCAmelCase       :     Union[str, Any]   				=			{
	    x for x in set(prime_sieve(1_00_00_00					)					) if len(str(_A					)					) - len(set(str(_A					)					)					) >= 3
	}

	for prime in primes:
		if prime in numbers_checked:
			continue

		lowerCAmelCase       :     Tuple   				=			digit_replacements(_A					)

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

			if len(_A					) != family_length:
				continue

			return min(_A					)

	return -1


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




'''simple docstring'''




import importlib.metadata
import sys

from transformers.testing_utils import TestCasePlus
from transformers.utils.versions import require_version, require_version_core


_lowerCAmelCase	:		Optional[int]		  =						importlib.metadata.version('numpy')
_lowerCAmelCase	:		List[Any]		  =						'.'.join([str(x) for x in sys.version_info[:3]])



class 			lowerCAmelCase					(					a				):



	def 					lowercase  (       self     ):
		# lt + different version strings
		require_version_core('numpy<1000.4.5'     )
		require_version_core('numpy<1000.4'     )
		require_version_core('numpy<1000'     )

		# le
		require_version_core('numpy<=1000.4.5'     )
		require_version_core(f"numpy<={numpy_ver}"     )

		# eq
		require_version_core(f"numpy=={numpy_ver}"     )

		# ne
		require_version_core('numpy!=1000.4.5'     )

		# ge
		require_version_core('numpy>=1.0'     )
		require_version_core('numpy>=1.0.0'     )
		require_version_core(f"numpy>={numpy_ver}"     )

		# gt
		require_version_core('numpy>1.0.0'     )

		# mix
		require_version_core('numpy>1.0.0,<1000'     )

		# requirement w/o version
		require_version_core('numpy'     )

		# unmet requirements due to version conflict
		for req in ["numpy==1.0.0", "numpy>=1000.0.0", f"numpy<{numpy_ver}"]:
			try:
				require_version_core(snake_case__     )
			except ImportError as e:
				self.assertIn(f"{req} is required"			,       str(snake_case__     )     )
				self.assertIn('but found'			,       str(snake_case__     )     )

        # unmet requirements due to missing module
		for req in ["numpipypie>1", "numpipypie2"]:
			try:
				require_version_core(snake_case__     )
			except importlib.metadata.PackageNotFoundError as e:
				self.assertIn(f"The '{req}' distribution was not found and is required by this application"			,       str(snake_case__     )     )
				self.assertIn('Try: pip install transformers -U'			,       str(snake_case__     )     )

        # bogus requirements formats:
        # 1. whole thing
		for req in ["numpy??1.0.0", "numpy1.0.0"]:
			try:
				require_version_core(snake_case__     )
			except ValueError as e:
				self.assertIn('requirement needs to be in the pip package format'			,       str(snake_case__     )     )
        # 2. only operators
		for req in ["numpy=1.0.0", "numpy == 1.00", "numpy<>1.0.0", "numpy><1.00", "numpy>>1.0.0"]:
			try:
				require_version_core(snake_case__     )
			except ValueError as e:
				self.assertIn('need one of '			,       str(snake_case__     )     )



	def 					lowercase  (       self     ):
		# matching requirement
		require_version('python>=3.6.0'     )

		# not matching requirements
		for req in ["python>9.9.9", "python<3.0.0"]:
			try:
				require_version_core(snake_case__     )
			except ImportError as e:
				self.assertIn(f"{req} is required"			,       str(snake_case__     )     )
				self.assertIn(f"but found python=={python_ver}"			,       str(snake_case__     )     )
