'''simple docstring'''


from itertools import permutations


def  _lowerCamelCase   (				lowerCamelCase_ :							tuple       ):



     """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

     UpperCAmelCase_							:       Optional[Any]       =				[7, 11, 13, 17]
     for i, test in enumerate(lowerCamelCase_       ):
          if (num[i + 4] * 100 + num[i + 5] * 10 + num[i + 6]) % test != 0:
               return False
     return True


def  _lowerCamelCase   (				lowerCamelCase_ :							int = 10       ):



     """simple docstring"""





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


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







'''simple docstring'''


from __future__ import annotations

from collections import deque
from collections.abc import Iterator
from dataclasses import dataclass






@dataclass
class 					__SCREAMING_SNAKE_CASE						:







  '''simple docstring'''






  lowerCamelCase_		:int
  lowerCamelCase_		:int







class 					__SCREAMING_SNAKE_CASE						:







  '''simple docstring'''






  def __init__(			self				,		snake_case_						):




       '''simple docstring'''

       UpperCAmelCase_							:       list[list[Edge]]       =				[[] for _ in range(snake_case_						)]
       UpperCAmelCase_							:       Any       =				size


  def __getitem__(			self				,		snake_case_						):




       '''simple docstring'''

       return iter(self._graph[vertex]						)


  @property
  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       return self._size


  def _UpperCamelCase					(			self				,		snake_case_				,		snake_case_				,		snake_case_						):




       '''simple docstring'''

       if weight not in (0, 1):
            raise ValueError('Edge weight must be either 0 or 1.'						)

       if to_vertex < 0 or to_vertex >= self.size:
            raise ValueError('Vertex indexes must be in [0; size).'						)

       self._graph[from_vertex].append(Edge(snake_case_				,		snake_case_						)						)






  def _UpperCamelCase					(			self				,		snake_case_				,		snake_case_						):




       '''simple docstring'''

       UpperCAmelCase_							:       Optional[int]       =				deque([start_vertex]						)
       UpperCAmelCase_							:       list[int | None]       =				[None] * self.size
       UpperCAmelCase_							:       str       =				0

       while queue:
            UpperCAmelCase_							:       Optional[int]       =				queue.popleft()
            UpperCAmelCase_							:       List[str]       =				distances[current_vertex]
            if current_distance is None:
                 continue

            for edge in self[current_vertex]:
                 UpperCAmelCase_							:       Union[str, Any]       =				current_distance + edge.weight
                 UpperCAmelCase_							:       Union[str, Any]       =				distances[edge.destination_vertex]
                 if (
                     isinstance(snake_case_				,		snake_case_						)
                     and new_distance >= dest_vertex_distance
                 ):
                      continue
                 UpperCAmelCase_							:       Optional[Any]       =				new_distance
                 if edge.weight == 0:
                      queue.appendleft(edge.destination_vertex						)
                 else:
                      queue.append(edge.destination_vertex						)

       if distances[finish_vertex] is None:
            raise ValueError('No path from start_vertex to finish_vertex.'						)

       return distances[finish_vertex]


if __name__ == "__main__":
 import doctest

 doctest.testmod()






