


from collections import deque



def   snake_case						(				_a:     Union[str, Any]							)->		Optional[int]:
      '''simple docstring'''


      lowerCamelCase__           =		len(_a							)
      lowerCamelCase__           =		deque()
      lowerCamelCase__           =		[False for _ in range(_a							)]
      lowerCamelCase__           =		[-1 for _ in range(_a							)]
      lowerCamelCase__           =		index_of[:]

      def strong_connect(_a:     Optional[Any]		,   _a:     str		,   _a:     Optional[int]							):
            lowerCamelCase__           =		index  # the number when this node is seen
            lowerCamelCase__           =		index  # lowest rank node reachable from here
            index += 1
            stack.append(_a							)
            lowerCamelCase__           =		True

            for w in g[v]:
                  if index_of[w] == -1:
                        lowerCamelCase__           =		strong_connect(_a		,   _a		,   _a							)
                        lowerCamelCase__           =		(
                            lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
                        )
                  elif on_stack[w]:
                        lowerCamelCase__           =		(
                            lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
                        )

            if lowlink_of[v] == index_of[v]:
                  lowerCamelCase__           =		[]
                  lowerCamelCase__           =		stack.pop()
                  lowerCamelCase__           =		False
                  component.append(_a							)
                  while w != v:
                        lowerCamelCase__           =		stack.pop()
                        lowerCamelCase__           =		False
                        component.append(_a							)
                  components.append(_a							)
            return index

      lowerCamelCase__           =		[]
      for v in range(_a							):
            if index_of[v] == -1:
                  strong_connect(_a		,   0		,   _a							)

      return components



def   snake_case						(				_a:     Optional[Any]		,   _a:     List[Any]							)->		Union[str, Any]:
      '''simple docstring'''


      lowerCamelCase__           =		[[] for _ in range(_a							)]
      for u, v in edges:
            g[u].append(_a							)
      return g


if __name__ == "__main__":
   # Test
   _snake_case          =							7
   _snake_case          =							[0, 0, 1, 2, 3, 3, 4, 4, 6]
   _snake_case          =							[1, 3, 2, 0, 1, 4, 5, 6, 5]
   _snake_case          =							[(u, v) for u, v in zip(source, target)]
   _snake_case          =							create_graph(n_vertices, edges)

   assert [[5], [6], [4], [3, 2, 1, 0]] == tarjan(g)







"""simple docstring"""


def   snake_case						(				_a:     List[Any]		,   _a:     Any		,   _a:     str		,   _a:     List[Any]							)->		List[Any]:
      '''simple docstring'''


      lowerCamelCase__           =		[False] * len(_a							)
      lowerCamelCase__           =		[]
      queue.append(_a							)
      lowerCamelCase__           =		True

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

      return visited[t]



def   snake_case						(				_a:     List[Any]		,   _a:     str		,   _a:     List[str]							)->		Optional[int]:
      '''simple docstring'''


      lowerCamelCase__           =		[-1] * (len(_a							))
      lowerCamelCase__           =		0
      while bfs(_a		,   _a		,   _a		,   _a							):
            lowerCamelCase__           =		float('Inf'							)
            lowerCamelCase__           =		sink

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

            max_flow += path_flow
            lowerCamelCase__           =		sink

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


_snake_case          =							[
    [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],
]

_snake_case      ,					_snake_case          =							0, 5






print(ford_fulkerson(graph, source, sink))



