



'''simple docstring'''


from itertools import permutations






def  UpperCAmelCase_       (		lowercase__       ):


     '''simple docstring'''







     if num[3] % 2 != 0:
          return False

     if (num[2] + num[3] + num[4]) % 3 != 0:
          return False

     if num[5] % 5 != 0:
          return False

     a_       		=[7, 1_1, 1_3, 1_7]
     for i, test in enumerate(lowercase__       ):
          if (num[i + 4] * 1_0_0 + num[i + 5] * 1_0 + num[i + 6]) % test != 0:
               return False
     return True






def  UpperCAmelCase_       (		lowercase__ = 1_0       ):


     '''simple docstring'''







     return sum(
         int("".join(map(lowercase__       ,	lowercase__       )       )       )
         for num in permutations(range(lowercase__       )       )
         if is_substring_divisible(lowercase__       )       )


if __name__ == "__main__":
  print(F"""{solution() = }""")







'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


lowercase							       =			{
    '''configuration_rag''': ['''RagConfig'''],
    '''retrieval_rag''': ['''RagRetriever'''],
    '''tokenization_rag''': ['''RagTokenizer'''],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase							       =			[
      '''RagModel''',
      '''RagPreTrainedModel''',
      '''RagSequenceForGeneration''',
      '''RagTokenForGeneration''',
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase							       =			[
      '''TFRagModel''',
      '''TFRagPreTrainedModel''',
      '''TFRagSequenceForGeneration''',
      '''TFRagTokenForGeneration''',
  ]


if TYPE_CHECKING:
  from .configuration_rag import RagConfig
  from .retrieval_rag import RagRetriever
  from .tokenization_rag import RagTokenizer

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_rag import RagModel, RagPreTrainedModel, RagSequenceForGeneration, RagTokenForGeneration

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_rag import (
        TFRagModel,
        TFRagPreTrainedModel,
        TFRagSequenceForGeneration,
        TFRagTokenForGeneration,
    )

else:
  import sys

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


