code: 
  
  
  '''simple docstring'''
  
  from typing import TYPE_CHECKING
  
  from ...utils import (
      OptionalDependencyNotAvailable,
      _LazyModule,
      is_tf_available,
      is_tokenizers_available,
      is_torch_available,
  )
  
  
  lowerCamelCase							:     List[str]								=			{
      """configuration_layoutlm""": ["""LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP""", """LayoutLMConfig""", """LayoutLMOnnxConfig"""],
      """tokenization_layoutlm""": ["""LayoutLMTokenizer"""],
  }
  
  try:
   if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
   pass
  else:
   lowerCamelCase							:     int								=			["""LayoutLMTokenizerFast"""]
  
  try:
   if not is_torch_available():
    raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
   pass
  else:
   lowerCamelCase							:     List[str]								=			[
       """LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST""",
       """LayoutLMForMaskedLM""",
       """LayoutLMForSequenceClassification""",
       """LayoutLMForTokenClassification""",
       """LayoutLMForQuestionAnswering""",
       """LayoutLMModel""",
       """LayoutLMPreTrainedModel""",
   ]
  
  try:
   if not is_tf_available():
    raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
   pass
  else:
   lowerCamelCase							:     Any								=			[
       """TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST""",
       """TFLayoutLMForMaskedLM""",
       """TFLayoutLMForSequenceClassification""",
       """TFLayoutLMForTokenClassification""",
       """TFLayoutLMForQuestionAnswering""",
       """TFLayoutLMMainLayer""",
       """TFLayoutLMModel""",
       """TFLayoutLMPreTrainedModel""",
   ]
  
  
  if TYPE_CHECKING:
   from .configuration_layoutlm import LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMConfig, LayoutLMOnnxConfig
   from .tokenization_layoutlm import LayoutLMTokenizer
  
   try:
    if not is_tokenizers_available():
     raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
    pass
   else:
    from .tokenization_layoutlm_fast import LayoutLMTokenizerFast
  
   try:
    if not is_torch_available():
     raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
    pass
   else:
    from .modeling_layoutlm import (
        LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST,
        LayoutLMForMaskedLM,
        LayoutLMForQuestionAnswering,
        LayoutLMForSequenceClassification,
        LayoutLMForTokenClassification,
        LayoutLMModel,
        LayoutLMPreTrainedModel,
    )
   try:
    if not is_tf_available():
     raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
    pass
   else:
    from .modeling_tf_layoutlm import (
        TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFLayoutLMForMaskedLM,
        TFLayoutLMForQuestionAnswering,
        TFLayoutLMForSequenceClassification,
        TFLayoutLMForTokenClassification,
        TFLayoutLMMainLayer,
        TFLayoutLMModel,
        TFLayoutLMPreTrainedModel,
    )
  
  else:
   import sys
  
   lowerCamelCase							:     List[Any]								=			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
  
  
  
  
  
style_context: 
  
  
  '''simple docstring'''
  
  from __future__ import annotations
  
  from collections import Counter
  
  def _SCREAMING_SNAKE_CASE   (A ) -> list[int]:
  
  
  
  
  
  
         """simple docstring"""
  
  
  
  
  
  
  
         lowercase__       =				[True] * n
         lowercase__       =				False
         lowercase__       =				False
         lowercase__       =				True
  
         for i in range(3						,				int(n**0.5 + 1 )						,				2 ):
                lowercase__       =				i * 2
                while index < n:
                       lowercase__       =				False
                       lowercase__       =				index + i
  
         lowercase__       =				[2]
  
         for i in range(3						,				A						,				2 ):
                if is_prime[i]:
                       primes.append(A )
  
         return primes
  
  def _SCREAMING_SNAKE_CASE   (A ) -> list[list[int]]:
  
  
  
  
  
  
         """simple docstring"""
  
  
  
  
  
  
  
         lowercase__       =				str(A )
         lowercase__       =				[]
         lowercase__       =				['''0''', '''1''', '''2''', '''3''', '''4''', '''5''', '''6''', '''7''', '''8''', '''9''']
  
         for duplicate in Counter(A ) - Counter(set(A ) ):
                lowercase__       =				[int(number_str.replace(A						,				A ) ) for digit in digits]
                replacements.append(A )
  
         return replacements
  
  def _SCREAMING_SNAKE_CASE   (A = 8 ) -> int:
  
  
  
  
  
  
         """simple docstring"""
  
  
  
  
  
  
  
         lowercase__       =				set()
  
         # Filter primes with less than 3 replaceable digits
         lowercase__       =				{
             x for x in set(prime_sieve(1_000_000 ) ) if len(str(A ) ) - len(set(str(A ) ) ) >= 3
         }
  
         for prime in primes:
                if prime in numbers_checked:
                       continue
  
                lowercase__       =				digit_replacements(A )
  
                for family in replacements:
                       numbers_checked.update(A )
                       lowercase__       =				primes.intersection(A )
  
                       if len(A ) != family_length:
                              continue
  
                       return min(A )
  
         return -1
  
  
  if __name__ == "__main__":
   print(solution())
  
  
  
  
  