




'''simple docstring'''




from __future__ import annotations

from collections import Counter




def 						snake_case__    ( lowerCamelCase__				:   int			)   ->   list[int]:
					A_ :     Optional[int] =							[True] * n
					A_ :     Union[str, Any] =							False
					A_ :     Union[str, Any] =							False
					A_ :     List[str] =							True

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

					A_ :     Tuple =							[2]

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

					return primes




def 						snake_case__    ( lowerCamelCase__				:   int			)   ->   list[list[int]]:
					A_ :     Any =							str(lowerCamelCase__			)
					A_ :     Optional[int] =							[]
					A_ :     Optional[Any] =							['''0''', '''1''', '''2''', '''3''', '''4''', '''5''', '''6''', '''7''', '''8''', '''9''']

					for duplicate in Counter(lowerCamelCase__			) - Counter(set(lowerCamelCase__			)			):
										A_ :     Union[str, Any] =							[int(number_str.replace(lowerCamelCase__			,		lowerCamelCase__			)			) for digit in digits]
										replacements.append(lowerCamelCase__			)

					return replacements




def 						snake_case__    ( lowerCamelCase__				:   int = 8			)   ->   int:
					A_ :     Optional[int] =							set()

					# Filter primes with less than 3 replaceable digits
					A_ :     Any =							{
					    x for x in set(prime_sieve(1_0_0_0_0_0_0			)			) if len(str(lowerCamelCase__			)			) - len(set(str(lowerCamelCase__			)			)			) >= 3
					}

					for prime in primes:
										if prime in numbers_checked:
															continue

										A_ :     List[str] =							digit_replacements(lowerCamelCase__			)

										for family in replacements:
															numbers_checked.update(lowerCamelCase__			)
															A_ :     int =							primes.intersection(lowerCamelCase__			)

															if len(lowerCamelCase__			) != family_length:
																				continue

															return min(lowerCamelCase__			)

					return -1


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









'''simple docstring'''




def 						snake_case__    ( lowerCamelCase__				:   float			)   ->   float:
					return -num if num < 0 else num




def 						snake_case__    ( lowerCamelCase__				:   list[int]			)   ->   int:
					if len(lowerCamelCase__			) == 0:
										raise ValueError('''abs_min() arg is an empty sequence'''			)
					A_ :     Any =							x[0]
					for i in x:
										if abs_val(lowerCamelCase__			) < abs_val(lowerCamelCase__			):
															A_ :     Tuple =							i
					return j




def 						snake_case__    ( lowerCamelCase__				:   list[int]			)   ->   int:
					if len(lowerCamelCase__			) == 0:
										raise ValueError('''abs_max() arg is an empty sequence'''			)
					A_ :     List[str] =							x[0]
					for i in x:
										if abs(lowerCamelCase__			) > abs(lowerCamelCase__			):
															A_ :     Any =							i
					return j




def 						snake_case__    ( lowerCamelCase__				:   list[int]			)   ->   int:
					if len(lowerCamelCase__			) == 0:
										raise ValueError('''abs_max_sort() arg is an empty sequence'''			)
					return sorted(lowerCamelCase__			,		key=lowerCamelCase__			)[-1]




def 						snake_case__    ( )   ->   Optional[Any]:
					assert abs_val(0			) == 0
					assert abs_val(3_4			) == 3_4
					assert abs_val(-1_0_0_0_0_0_0_0_0_0_0_0			) == 1_0_0_0_0_0_0_0_0_0_0_0

					A_ :     Dict =							[-3, -1, 2, -1_1]
					assert abs_max(lowerCamelCase__			) == -1_1
					assert abs_max_sort(lowerCamelCase__			) == -1_1
					assert abs_min(lowerCamelCase__			) == -1


if __name__ == "__main__":
							import doctest

							doctest.testmod()

							test_abs_val()
							print(abs_val(-34))  # --> 34



