'''simple docstring'''




from __future__ import annotations

from collections import Counter

def _UpperCamelCase (							SCREAMING_SNAKE_CASE_				):
     lowercase_       :							Optional[Any]  					=       [True] * n
     lowercase_       :							int  					=       False
     lowercase_       :							str  					=       False
     lowercase_       :							str  					=       True

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

     lowercase_       :							Union[str, Any]  					=       [2]

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

     return primes

def _UpperCamelCase (							SCREAMING_SNAKE_CASE_				):
     lowercase_       :							int  					=       str(SCREAMING_SNAKE_CASE_				)
     lowercase_       :							str  					=       []
     lowercase_       :							Dict  					=       ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']

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

     return replacements

def _UpperCamelCase (							SCREAMING_SNAKE_CASE_ = 8				):
     lowercase_       :							List[Any]  					=       set()

     # Filter primes with less than 3 replaceable digits
     lowercase_       :							str  					=       {
         x for x in set(prime_sieve(1_000_000				)				) if len(str(SCREAMING_SNAKE_CASE_				)				) - len(set(str(SCREAMING_SNAKE_CASE_				)				)				) >= 3
     }

     for prime in primes:
          if prime in numbers_checked:
               continue

          lowercase_       :							Optional[Any]  					=       digit_replacements(SCREAMING_SNAKE_CASE_				)

          for family in replacements:
               numbers_checked.update(SCREAMING_SNAKE_CASE_				)
               lowercase_       :							Optional[Any]  					=       primes.intersection(SCREAMING_SNAKE_CASE_				)

               if len(SCREAMING_SNAKE_CASE_				) != family_length:
                    continue

               return min(SCREAMING_SNAKE_CASE_				)

     return -1


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





'''simple docstring'''




from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


_A										= {
    'configuration_rwkv': ['RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP', 'RwkvConfig', 'RwkvOnnxConfig'],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _A										= [
     'RWKV_PRETRAINED_MODEL_ARCHIVE_LIST',
     'RwkvForCausalLM',
     'RwkvModel',
     'RwkvPreTrainedModel',
 ]


if TYPE_CHECKING:
 from .configuration_rwkv import RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP, RwkvConfig, RwkvOnnxConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_rwkv import (
      RWKV_PRETRAINED_MODEL_ARCHIVE_LIST,
      RwkvForCausalLM,
      RwkvModel,
      RwkvPreTrainedModel,
  )
else:
 import sys

 _A										= _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




