





'''simple docstring'''




def 						__lowerCamelCase			(	UpperCAmelCase_					,				UpperCAmelCase_					,				UpperCAmelCase_					,				UpperCAmelCase_							)   ->Any:
	# Return True if there is node that has not iterated.
	snake_case__	       =   [False] * len(UpperCAmelCase_							)
	snake_case__	       =   []
	queue.append(UpperCAmelCase_							)
	snake_case__	       =   True

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

	return visited[t]




def 						__lowerCamelCase			(	UpperCAmelCase_					,				UpperCAmelCase_					,				UpperCAmelCase_							)   ->Dict:
	# This array is filled by BFS and to store path
	snake_case__	       =   [-1] * (len(UpperCAmelCase_							))
	snake_case__	       =   0
	while bfs(UpperCAmelCase_					,				UpperCAmelCase_					,				UpperCAmelCase_					,				UpperCAmelCase_							):
		snake_case__	       =   float('Inf'							)
		snake_case__	       =   sink

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

		max_flow += path_flow
		snake_case__	       =   sink

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


a__					:			Optional[Any]          =     [
    [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__					:			Optional[Any]          =     0, 5







print(ford_fulkerson(graph, source, sink))










'''simple docstring'''




from math import loga




def 						__lowerCamelCase			(	UpperCAmelCase_							)   ->int:
	if a < 0:
		raise ValueError('Input value must be a positive integer'							)
	elif isinstance(UpperCAmelCase_					,				UpperCAmelCase_							):
		raise TypeError('Input value must be a \'int\' type'							)
	return 0 if (a == 0) else int(loga(a & -a							)							)


if __name__ == "__main__":
			import doctest

			doctest.testmod()



