



'''simple docstring'''






UpperCamelCase__:     Optional[int]										=    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"


def 				snake_case_  (      )   ->     None:
							UpperCAmelCase				: List[str]											=	input('''Enter message: '''						)
							UpperCAmelCase				: Union[str, Any]											=	input('''Enter key [alphanumeric]: '''						)
							UpperCAmelCase				: List[str]											=	input('''Encrypt/Decrypt [e/d]: '''						)

							if mode.lower().startswith('''e'''						):
														UpperCAmelCase				: List[Any]											=	'''encrypt'''
														UpperCAmelCase				: int											=	encrypt_message(_lowerCAmelCase     ,   _lowerCAmelCase						)
							elif mode.lower().startswith('''d'''						):
														UpperCAmelCase				: Any											=	'''decrypt'''
														UpperCAmelCase				: Optional[int]											=	decrypt_message(_lowerCAmelCase     ,   _lowerCAmelCase						)

							print(f"""\n{mode.title()}ed message:"""						)
							print(_lowerCAmelCase						)


def 				snake_case_  (      _lowerCAmelCase						:		str     ,   _lowerCAmelCase						:		str						)   ->     str:
							return translate_message(_lowerCAmelCase     ,   _lowerCAmelCase     ,   '''encrypt'''						)


def 				snake_case_  (      _lowerCAmelCase						:		str     ,   _lowerCAmelCase						:		str						)   ->     str:
							return translate_message(_lowerCAmelCase     ,   _lowerCAmelCase     ,   '''decrypt'''						)


def 				snake_case_  (      _lowerCAmelCase						:		str     ,   _lowerCAmelCase						:		str     ,   _lowerCAmelCase						:		str						)   ->     str:
							UpperCAmelCase				: Any											=	[]
							UpperCAmelCase				: Union[str, Any]											=	0
							UpperCAmelCase				: Optional[Any]											=	key.upper()

							for symbol in message:
														UpperCAmelCase				: Dict											=	LETTERS.find(symbol.upper()						)
														if num != -1:
																					if mode == "encrypt":
																												num += LETTERS.find(key[key_index]						)
																					elif mode == "decrypt":
																												num -= LETTERS.find(key[key_index]						)

																					num %= len(_lowerCAmelCase						)

																					if symbol.isupper():
																												translated.append(LETTERS[num]						)
																					elif symbol.islower():
																												translated.append(LETTERS[num].lower()						)

																					key_index += 1
																					if key_index == len(_lowerCAmelCase						):
																												UpperCAmelCase				: int											=	0
														else:
																					translated.append(_lowerCAmelCase						)
							return "".join(_lowerCAmelCase						)


if __name__ == "__main__":
						main()










'''simple docstring'''






def 				snake_case_  (      _lowerCAmelCase						:		Tuple     ,   _lowerCAmelCase						:		Tuple     ,   _lowerCAmelCase						:		int     ,   _lowerCAmelCase						:		Tuple						)   ->     Union[str, Any]:
							# Return True if there is node that has not iterated.
							UpperCAmelCase				: Optional[Any]											=	[False] * len(_lowerCAmelCase						)
							UpperCAmelCase				: Dict											=	[]
							queue.append(_lowerCAmelCase						)
							UpperCAmelCase				: str											=	True

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

							return visited[t]


def 				snake_case_  (      _lowerCAmelCase						:		Union[str, Any]     ,   _lowerCAmelCase						:		List[str]     ,   _lowerCAmelCase						:		List[str]						)   ->     Any:
							# This array is filled by BFS and to store path
							UpperCAmelCase				: Dict											=	[-1] * (len(_lowerCAmelCase						))
							UpperCAmelCase				: Any											=	0
							while bfs(_lowerCAmelCase     ,   _lowerCAmelCase     ,   _lowerCAmelCase     ,   _lowerCAmelCase						):
														UpperCAmelCase				: List[str]											=	float('''Inf'''						)
														UpperCAmelCase				: str											=	sink

														while s != source:
																					# Find the minimum value in select path
																					UpperCAmelCase				: int											=	min(_lowerCAmelCase     ,   graph[parent[s]][s]						)
																					UpperCAmelCase				: Tuple											=	parent[s]

														max_flow += path_flow
														UpperCAmelCase				: Optional[Any]											=	sink

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


UpperCamelCase__:     Tuple										=    [
    [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__:     int										=    0, 5




print(ford_fulkerson(graph, source, sink))





