






'''simple docstring'''


from __future__ import annotations

from collections import Counter







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





						UpperCamelCase__       =			[True] * n
						UpperCamelCase__       =			False
						UpperCamelCase__       =			False
						UpperCamelCase__       =			True

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

						UpperCamelCase__       =			[2]

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

						return primes







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





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

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

						return replacements







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





						UpperCamelCase__       =			set()

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

						for prime in primes:
												if prime in numbers_checked:
																		continue

												UpperCamelCase__       =			digit_replacements(_A       )

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

																		if len(_A       ) != family_length:
																								continue

																		return min(_A       )

						return -1


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








'''simple docstring'''


from itertools import combinations_with_replacement







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





						UpperCamelCase__       =			[*list(range(1    ,   21       )       ), 25]
						UpperCamelCase__       =			[2 * x for x in range(1    ,   21       )] + [50]
						UpperCamelCase__       =			[3 * x for x in range(1    ,   21       )]
						UpperCamelCase__       =			singles + doubles + triples + [0]

						UpperCamelCase__       =			0
						UpperCamelCase__       =			42
						UpperCamelCase__       =			42
						UpperCamelCase__       =			42
						UpperCamelCase__       =			42

						for double in doubles:
												for throwa, throwa in combinations_with_replacement(_A    ,   2       ):
																		UpperCamelCase__       =			double + throwa + throwa
																		if checkout_total < limit:
																								num_checkouts += 1

						return num_checkouts


if __name__ == "__main__":
					print(f"""{solution() = }""")
