

"""simple docstring"""






from __future__ import annotations

from collections import Counter
def 		A_	(   __UpperCamelCase     :				Union[str, Any]				):
		lowercase										=							[True] * n
		lowercase										=							False
		lowercase										=							False
		lowercase										=							True

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

		lowercase										=							[2]

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

		return primes
def 		A_	(   __UpperCamelCase     :				Any				):
		lowercase										=							str(_A				)
		lowercase										=							[]
		lowercase										=							['''0''', '''1''', '''2''', '''3''', '''4''', '''5''', '''6''', '''7''', '''8''', '''9''']

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

		return replacements
def 		A_	(   __UpperCamelCase     :				Union[str, Any] = 8				):
		lowercase										=							set()

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

				lowercase										=							digit_replacements(_A				)

				for family in replacements:
						numbers_checked.update(_A				)
						lowercase										=							primes.intersection(_A				)

						if len(_A				) != family_length:
								continue

						return min(_A				)

		return -1


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







'''simple docstring'''


def 						__magic_name__(			_A       ):
						'''simple docstring'''





						UpperCamelCase__       =			len(_A       )

						# Set the gap value to be decreased by a factor of 1.3
						# after each iteration
						UpperCamelCase__       =			1.3

						# Continue sorting until the gap is 1
						while gap > 1:
												# Decrease the gap value
												UpperCamelCase__       =			int(gap / shrink       )

												# Sort the elements using insertion sort
												for i in range(_A    ,   len(_A       )       ):
																		UpperCamelCase__       =			collection[i]
																		UpperCamelCase__       =			i
																		while j >= gap and collection[j - gap] > temp:
																								UpperCamelCase__       =			collection[j - gap]
																								j -= gap
																		UpperCamelCase__       =			temp

						return collection


if __name__ == "__main__":
					import doctest

					doctest.testmod()
