





'''simple docstring'''




from __future__ import annotations

import random




class       UpperCamelCase__			:




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__						=					6


					def __init__(		self							:	int		):

							'''simple docstring'''



							SCREAMING_SNAKE_CASE				:							Dict						=	list(range(1     ,		Dice.NUM_SIDES + 1		)		)



					def lowerCamelCase_	(		self							:	Tuple		):

							'''simple docstring'''



							return random.choice(self.sides		)







def 						__A						(       lowerCamelCase_	,	lowerCamelCase_ = 2					):


		"""simple docstring"""



		SCREAMING_SNAKE_CASE				:							str						=	[Dice() for i in range(lowerCamelCase_					)]
		SCREAMING_SNAKE_CASE				:							Dict						=	[0] * (len(lowerCamelCase_					) * Dice.NUM_SIDES + 1)
		for _ in range(lowerCamelCase_					):
				count_of_sum[sum(dice.roll() for dice in dices					)] += 1
		SCREAMING_SNAKE_CASE				:							int						=	[round((count * 1_00) / num_throws	,	2					) for count in count_of_sum]
		return probability[num_dice:]  # remove probability of sums that never appear


if __name__ == "__main__":
							import doctest

							doctest.testmod()










'''simple docstring'''




from __future__ import annotations

from collections import Counter



def 						__A						(       lowerCamelCase_					):


		"""simple docstring"""



		SCREAMING_SNAKE_CASE				:							int						=	[True] * n
		SCREAMING_SNAKE_CASE				:							Optional[Any]						=	False
		SCREAMING_SNAKE_CASE				:							Optional[Any]						=	False
		SCREAMING_SNAKE_CASE				:							Optional[int]						=	True

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

		SCREAMING_SNAKE_CASE				:							Dict						=	[2]

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

		return primes



def 						__A						(       lowerCamelCase_					):


		"""simple docstring"""



		SCREAMING_SNAKE_CASE				:							List[str]						=	str(lowerCamelCase_					)
		SCREAMING_SNAKE_CASE				:							List[str]						=	[]
		SCREAMING_SNAKE_CASE				:							Optional[int]						=	["""0""", """1""", """2""", """3""", """4""", """5""", """6""", """7""", """8""", """9"""]

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

		return replacements



def 						__A						(       lowerCamelCase_ = 8					):


		"""simple docstring"""



		SCREAMING_SNAKE_CASE				:							Tuple						=	set()

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

		for prime in primes:
				if prime in numbers_checked:
						continue

				SCREAMING_SNAKE_CASE				:							int						=	digit_replacements(lowerCamelCase_					)

				for family in replacements:
						numbers_checked.update(lowerCamelCase_					)
						SCREAMING_SNAKE_CASE				:							Dict						=	primes.intersection(lowerCamelCase_					)

						if len(lowerCamelCase_					) != family_length:
								continue

						return min(lowerCamelCase_					)

		return -1


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



