


"""simple docstring"""


class snake_case      :







		def __init__(					self      :       int    ,   a__      :       int		)       ->						Optional[int]:





						'''simple docstring'''







						_A					  =			n
						_A					  =			[None] * self.n
						_A					  =			0  # index of the first element
						_A					  =			0
						_A					  =			0







		def __len__(					self      :       str		)       ->						int:





						'''simple docstring'''







						return self.size







		def  a_ (					self      :       List[str]		)       ->						bool:





						'''simple docstring'''







						return self.size == 0







		def  a_ (					self      :       List[Any]		)       ->						Tuple:





						'''simple docstring'''







						return False if self.is_empty() else self.array[self.front]







		def  a_ (					self      :       List[str]    ,   a__      :       int		)       ->						Tuple:





						'''simple docstring'''







						if self.size >= self.n:
										raise Exception("QUEUE IS FULL"		)

						_A					  =			data
						_A					  =			(self.rear + 1) % self.n
						self.size += 1
						return self







		def  a_ (					self      :       str		)       ->						str:





						'''simple docstring'''







						if self.size == 0:
										raise Exception("UNDERFLOW"		)

						_A					  =			self.array[self.front]
						_A					  =			None
						_A					  =			(self.front + 1) % self.n
						self.size -= 1
						return temp



"""simple docstring"""


def      a__ (				__lowercase     ,			__lowercase     ,			__lowercase     ,			__lowercase   )	->	str:
				# Return True if there is node that has not iterated.
				_A					  =			[False] * len(__lowercase   )
				_A					  =			[]
				queue.append(__lowercase   )
				_A					  =			True

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

				return visited[t]






def      a__ (				__lowercase     ,			__lowercase     ,			__lowercase   )	->	int:
				# This array is filled by BFS and to store path
				_A					  =			[-1] * (len(__lowercase   ))
				_A					  =			0
				while bfs(__lowercase     ,			__lowercase     ,			__lowercase     ,			__lowercase   ):
								_A					  =			float("Inf"   )
								_A					  =			sink

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

								max_flow += path_flow
								_A					  =			sink

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


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

a_							,     a_       							=    0, 5




print(ford_fulkerson(graph, source, sink))