


"""simple docstring"""

from itertools import permutations


def lowerCAmelCase_      (				UpperCamelCase__	: 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

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


def lowerCAmelCase_      (				UpperCamelCase__	: int = 10 ):






 """simple docstring"""







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


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






"""simple docstring"""

def lowerCAmelCase_      (				UpperCamelCase__	: Optional[Any]				,   UpperCamelCase__	: int				,   UpperCamelCase__	: Optional[Any]				,   UpperCamelCase__	: str ):






 """simple docstring"""







 __lowercase									=	[False] * len(UpperCamelCase__ )
 __lowercase									=	[]
 queue.append(UpperCamelCase__ )
 __lowercase									=	True

 while queue:
  __lowercase									=	queue.pop(0 )
  for ind in range(len(graph[u] ) ):
   if visited[ind] is False and graph[u][ind] > 0:
    queue.append(UpperCamelCase__ )
    __lowercase									=	True
    __lowercase									=	u

 return visited[t]


def lowerCAmelCase_      (				UpperCamelCase__	: str				,   UpperCamelCase__	: Any				,   UpperCamelCase__	: Optional[int] ):






 """simple docstring"""







 __lowercase									=	[-1] * (len(UpperCamelCase__ ))
 __lowercase									=	0
 while bfs(UpperCamelCase__				,   UpperCamelCase__				,   UpperCamelCase__				,   UpperCamelCase__ ):
  __lowercase									=	float("""Inf""" )
  __lowercase									=	sink

  while s != source:
   # Find the minimum value in select path
   __lowercase									=	min(UpperCamelCase__				,   graph[parent[s]][s] )
   __lowercase									=	parent[s]

  max_flow += path_flow
  __lowercase									=	sink

  while v != source:
   __lowercase									=	parent[v]
   graph[u][v] -= path_flow
   graph[v][u] += path_flow
   __lowercase									=	parent[v]
 return max_flow


UpperCAmelCase__  							=[
    [0, 16, 13, 0, 0, 0],
    [0, 0, 10, 12, 0, 0],
    [0, 4, 0, 0, 14, 0],
    [0, 0, 9, 0, 0, 20],
    [0, 0, 0, 7, 0, 4],
    [0, 0, 0, 0, 0, 0],
]

UpperCAmelCase__							,      UpperCAmelCase__  							=0, 5

print(ford_fulkerson(graph, source, sink))
