'''simple docstring'''




from __future__ import annotations

from collections import Counter





def      _UpperCAmelCase    (							_UpperCamelCase    :	List[Any]   )	->      Optional[Any]:
    A_     =   [True] * n
    A_     =   False
    A_     =   False
    A_     =   True

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

    A_     =   [2]

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

    return primes





def      _UpperCAmelCase    (							_UpperCamelCase    :	str   )	->      Optional[int]:
    A_     =   str(__UpperCAmelCase   )
    A_     =   []
    A_     =   ["""0""", """1""", """2""", """3""", """4""", """5""", """6""", """7""", """8""", """9"""]

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

    return replacements





def      _UpperCAmelCase    (							_UpperCamelCase    :	Optional[Any] = 8   )	->      List[str]:
    A_     =   set()

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

    for prime in primes:
        if prime in numbers_checked:
            continue

        A_     =   digit_replacements(__UpperCAmelCase   )

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

            if len(__UpperCAmelCase   ) != family_length:
                continue

            return min(__UpperCAmelCase   )

    return -1


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











"""simple docstring"""







import unittest
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest.mock import Mock, patch

import diffusers.utils.hub_utils





class    UpperCamelCase     (			unittest.TestCase    ):




	"""simple docstring"""






	@patch("""diffusers.utils.hub_utils.get_full_repo_name"""					)
	def 					lowerCamelCase__ (			self							,UpperCAmelCase_					):
			_lowercase							:      List[Any]			=					"""full_repo_name"""
			with TemporaryDirectory() as tmpdir:
					# Dummy args values
					_lowercase							:      Optional[Any]			=					Mock()
					_lowercase							:      int			=					tmpdir
					_lowercase							:      int			=					0
					_lowercase							:      Optional[Any]			=					"""hub_token"""
					_lowercase							:      Optional[Any]			=					"""dataset_name"""
					_lowercase							:      List[Any]			=					0.01
					_lowercase							:      Tuple			=					10_00_00
					_lowercase							:      Optional[Any]			=					1_00_00
					_lowercase							:      Optional[int]			=					0.01
					_lowercase							:      Tuple			=					0.02
					_lowercase							:      int			=					0.03
					_lowercase							:      Optional[int]			=					0.0005
					_lowercase							:      Tuple			=					0.000001
					_lowercase							:      int			=					1
					_lowercase							:      List[str]			=					10
					_lowercase							:      Optional[Any]			=					0.001
					_lowercase							:      int			=					0.1
					_lowercase							:      Optional[Any]			=					0.2
					_lowercase							:      Tuple			=					True

					# Model card mush be rendered and saved
					diffusers.utils.hub_utils.create_model_card(UpperCAmelCase_							,model_name="""model_name"""					)
					self.assertTrue((Path(UpperCAmelCase_					) / """README.md""").is_file()					)



