from __future__ import annotations

from collections import Counter






def    UpperCAmelCase__(						lowerCamelCase_  ):



			"""simple docstring"""





			_snake_case              =      [True] * n
			_snake_case              =      False
			_snake_case              =      False
			_snake_case              =      True

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

			_snake_case              =      [2]

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

			return primes






def    UpperCAmelCase__(						lowerCamelCase_  ):



			"""simple docstring"""





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

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

			return replacements






def    UpperCAmelCase__(						lowerCamelCase_ = 8  ):



			"""simple docstring"""





			_snake_case              =      set()

			# Filter primes with less than 3 replaceable digits
			_snake_case              =      {
			    x for x in set(prime_sieve(1000000  )  ) if len(str(lowerCamelCase_  )  ) - len(set(str(lowerCamelCase_  )  )  ) >= 3
			}

			for prime in primes:
						if prime in numbers_checked:
									continue

						_snake_case              =      digit_replacements(lowerCamelCase_  )

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

									if len(lowerCamelCase_  ) != family_length:
												continue

									return min(lowerCamelCase_  )

			return -1


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


import unittest

from transformers import BlenderbotTokenizer, BlenderbotTokenizerFast
from transformers.utils import cached_property

class 	_SCREAMING_SNAKE_CASE							(     unittest.TestCase							):






		"""simple docstring"""







		@cached_property
		def 				_a				(			self    :				Tuple   ):






					"""simple docstring"""
					return BlenderbotTokenizer.from_pretrained("facebook/blenderbot-3B"   )



		@cached_property
		def 				_a				(			self    :				Tuple   ):






					"""simple docstring"""
					return BlenderbotTokenizerFast.from_pretrained("facebook/blenderbot-3B"   )



		def 				_a				(			self    :				Optional[Any]   ):






					"""simple docstring"""
					_snake_case              =      self.tokenizer_ab
					_snake_case              =      " I am a small frog."
					_snake_case              =      tok([src_text]  ,					padding=__SCREAMING_SNAKE_CASE  ,					truncation=__SCREAMING_SNAKE_CASE   )["input_ids"]
					_snake_case              =      tok.batch_decode(__SCREAMING_SNAKE_CASE  ,					skip_special_tokens=__SCREAMING_SNAKE_CASE  ,					clean_up_tokenization_spaces=__SCREAMING_SNAKE_CASE   )[0]
					assert src_text == decoded



		def 				_a				(			self    :				str   ):






					"""simple docstring"""
					_snake_case              =      self.rust_tokenizer_ab
					_snake_case              =      " I am a small frog."
					_snake_case              =      tok([src_text]  ,					padding=__SCREAMING_SNAKE_CASE  ,					truncation=__SCREAMING_SNAKE_CASE   )["input_ids"]
					_snake_case              =      tok.batch_decode(__SCREAMING_SNAKE_CASE  ,					skip_special_tokens=__SCREAMING_SNAKE_CASE  ,					clean_up_tokenization_spaces=__SCREAMING_SNAKE_CASE   )[0]
					assert src_text == decoded



		def 				_a				(			self    :				Optional[Any]   ):






					"""simple docstring"""
					assert self.tokenizer_ab.add_prefix_space
					assert self.tokenizer_ab([" Sam", "Sam"]   ).input_ids == [[5_502, 2], [5_502, 2]]







		def 				_a				(			self    :				str   ):






					"""simple docstring"""
					assert self.rust_tokenizer_ab.add_prefix_space
					assert self.rust_tokenizer_ab([" Sam", "Sam"]   ).input_ids == [[5_502, 2], [5_502, 2]]

