


'''simple docstring'''






import logging
import os
from logging import (
    CRITICAL,  # NOQA
    DEBUG,  # NOQA
    ERROR,  # NOQA
    FATAL,  # NOQA
    INFO,  # NOQA
    NOTSET,  # NOQA
    WARN,  # NOQA
    WARNING,  # NOQA
)
from typing import Optional

from tqdm import auto as tqdm_lib


__A	:	int     =     {
    'debug': logging.DEBUG,
    'info': logging.INFO,
    'warning': logging.WARNING,
    'error': logging.ERROR,
    'critical': logging.CRITICAL,
}

__A	:	List[str]     =     logging.WARNING





def      UpperCAmelCase      (		):







		'''simple docstring'''
		snake_case_		:							Optional[int]			       =						os.getenv("""DATASETS_VERBOSITY"""				,      lowerCamelCase_ )
		if env_level_str:
				if env_level_str in log_levels:
						return log_levels[env_level_str]
				else:
						logging.getLogger().warning(
						    F'''Unknown option DATASETS_VERBOSITY={env_level_str}, '''
						    F'''has to be one of: { ", ".join(log_levels.keys() ) }''' )
		return _default_log_level





def      UpperCAmelCase      (		):







		'''simple docstring'''
		return __name__.split(""".""" )[0]





def      UpperCAmelCase      (		):







		'''simple docstring'''
		return logging.getLogger(_get_library_name() )





def      UpperCAmelCase      (		):







		'''simple docstring'''
		snake_case_		:							int			       =						_get_library_root_logger()
		library_root_logger.setLevel(_get_default_logging_level() )





def      UpperCAmelCase      (		):







		'''simple docstring'''
		snake_case_		:							str			       =						_get_library_root_logger()
		library_root_logger.setLevel(logging.NOTSET )





def      UpperCAmelCase      (		lowerCamelCase_  :Optional[str] = None ):







		'''simple docstring'''
		if name is None:
				snake_case_		:							List[str]			       =						_get_library_name()
		return logging.getLogger(lowerCamelCase_ )





def      UpperCAmelCase      (		):







		'''simple docstring'''
		return _get_library_root_logger().getEffectiveLevel()





def      UpperCAmelCase      (		lowerCamelCase_  :int ):







		'''simple docstring'''
		_get_library_root_logger().setLevel(lowerCamelCase_ )





def      UpperCAmelCase      (		):







		'''simple docstring'''
		return set_verbosity(lowerCamelCase_ )





def      UpperCAmelCase      (		):







		'''simple docstring'''
		return set_verbosity(lowerCamelCase_ )





def      UpperCAmelCase      (		):







		'''simple docstring'''
		return set_verbosity(lowerCamelCase_ )





def      UpperCAmelCase      (		):







		'''simple docstring'''
		return set_verbosity(lowerCamelCase_ )





def      UpperCAmelCase      (		):







		'''simple docstring'''
		snake_case_		:							Optional[int]			       =						False





def      UpperCAmelCase      (		):







		'''simple docstring'''
		snake_case_		:							Any			       =						True


# Configure the library root logger at the module level (singleton-like)
_configure_library_root_logger()
class 						__UpperCamelCase	:





							def __init__(  self		:Optional[Any]  ,*_UpperCamelCase		:List[Any]  ,**_UpperCamelCase		:List[Any]			):  # pylint: disable=unused-argument
									snake_case_		:							Optional[int]			       =						args[0] if args else None





							def __iter__(  self		:List[Any]			):
									return iter(self._iterator			)





							def __getattr__(  self		:int  ,_UpperCamelCase		:int			):

									def empty_fn(*_UpperCamelCase		:Optional[int]  ,**_UpperCamelCase		:int			):  # pylint: disable=unused-argument
											return

									return empty_fn





							def __enter__(  self		:Tuple			):
									return self





							def __exit__(  self		:Optional[Any]  ,_UpperCamelCase		:Optional[int]  ,_UpperCamelCase		:Union[str, Any]  ,_UpperCamelCase		:Optional[Any]			):
									return





__A	:	List[Any]     =     True
class 						__UpperCamelCase	:





							def __call__(  self		:List[Any]  ,*_UpperCamelCase		:int  ,_UpperCamelCase		:Any=False  ,**_UpperCamelCase		:Optional[Any]			):
									if _tqdm_active and not disable:
											return tqdm_lib.tqdm(*_UpperCamelCase  ,**_UpperCamelCase			)
									else:
											return EmptyTqdm(*_UpperCamelCase  ,**_UpperCamelCase			)





							def 		a__   (  self		:Any  ,*_UpperCamelCase		:Optional[int]  ,**_UpperCamelCase		:Tuple			):
									snake_case_		:							int			       =						None
									if _tqdm_active:
											return tqdm_lib.tqdm.set_lock(*_UpperCamelCase  ,**_UpperCamelCase			)





							def 		a__   (  self		:Tuple			):
									if _tqdm_active:
											return tqdm_lib.tqdm.get_lock()





__A	:	str     =     _tqdm_cls()





def      UpperCAmelCase      (		):







		'''simple docstring'''
		global _tqdm_active
		return bool(_tqdm_active )





def      UpperCAmelCase      (		):







		'''simple docstring'''
		global _tqdm_active
		snake_case_		:							Tuple			       =						True






def      UpperCAmelCase      (		):







		'''simple docstring'''
		global _tqdm_active
		snake_case_		:							Union[str, Any]			       =						False



'''simple docstring'''






def      UpperCAmelCase      (		lowerCamelCase_  :Tuple				,      lowerCamelCase_  :Optional[Any]				,      lowerCamelCase_  :str				,      lowerCamelCase_  :str ):







		'''simple docstring'''
		# Return True if there is node that has not iterated.
		snake_case_		:							Optional[int]			       =						[False] * len(lowerCamelCase_ )
		snake_case_		:							Dict			       =						[]
		queue.append(lowerCamelCase_ )
		snake_case_		:							Tuple			       =						True

		while queue:
				snake_case_		:							Union[str, Any]			       =						queue.pop(0 )
				for ind in range(len(graph[u] ) ):
						if visited[ind] is False and graph[u][ind] > 0:
								queue.append(lowerCamelCase_ )
								snake_case_		:							str			       =						True
								snake_case_		:							Optional[Any]			       =						u

		return visited[t]





def      UpperCAmelCase      (		lowerCamelCase_  :Optional[Any]				,      lowerCamelCase_  :Dict				,      lowerCamelCase_  :Union[str, Any] ):







		'''simple docstring'''
		# This array is filled by BFS and to store path
		snake_case_		:							Optional[int]			       =						[-1] * (len(lowerCamelCase_ ))
		snake_case_		:							Tuple			       =						0
		while bfs(lowerCamelCase_				,      lowerCamelCase_				,      lowerCamelCase_				,      lowerCamelCase_ ):
				snake_case_		:							int			       =						float("""Inf""" )
				snake_case_		:							Any			       =						sink

				while s != source:
						# Find the minimum value in select path
						snake_case_		:							Optional[Any]			       =						min(lowerCamelCase_				,      graph[parent[s]][s] )
						snake_case_		:							Union[str, Any]			       =						parent[s]

				max_flow += path_flow
				snake_case_		:							Dict			       =						sink

				while v != source:
						snake_case_		:							Optional[int]			       =						parent[v]
						graph[u][v] -= path_flow
						graph[v][u] += path_flow
						snake_case_		:							Any			       =						parent[v]
		return max_flow


__A	:	Union[str, 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	:	Union[str, Any]     =     0, 5






print(ford_fulkerson(graph, source, sink))