
'''simple docstring'''







def  snake_case_		(    __SCREAMING_SNAKE_CASE :			Optional[Any]				,				__SCREAMING_SNAKE_CASE :			Optional[int]				,				__SCREAMING_SNAKE_CASE :			Union[str, Any]				,				__SCREAMING_SNAKE_CASE :			List[str]							):



						"""simple docstring"""





						lowercase_     :					Dict													=	[False] * len(__SCREAMING_SNAKE_CASE							)
						lowercase_     :					str													=	[]
						queue.append(__SCREAMING_SNAKE_CASE							)
						lowercase_     :					Any													=	True

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

						return visited[t]
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			List[Any]				,				__SCREAMING_SNAKE_CASE :			Optional[int]				,				__SCREAMING_SNAKE_CASE :			Optional[Any]							):



						"""simple docstring"""





						lowercase_     :					List[Any]													=	[-1] * (len(__SCREAMING_SNAKE_CASE							))
						lowercase_     :					Any													=	0
						while bfs(__SCREAMING_SNAKE_CASE				,				__SCREAMING_SNAKE_CASE				,				__SCREAMING_SNAKE_CASE				,				__SCREAMING_SNAKE_CASE							):
												lowercase_     :					int													=	float('''Inf'''							)
												lowercase_     :					Optional[Any]													=	sink

												while s != source:
																		# Find the minimum value in select path
																		lowercase_     :					Optional[int]													=	min(__SCREAMING_SNAKE_CASE				,				graph[parent[s]][s]							)
																		lowercase_     :					Optional[Any]													=	parent[s]

												max_flow += path_flow
												lowercase_     :					List[str]													=	sink

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


_lowercase			:  Optional[int]   							=	[
    [0, 1_6, 1_3, 0, 0, 0],
    [0, 0, 1_0, 1_2, 0, 0],
    [0, 4, 0, 0, 1_4, 0],
    [0, 0, 9, 0, 0, 2_0],
    [0, 0, 0, 7, 0, 4],
    [0, 0, 0, 0, 0, 0],
]

_lowercase							,  _lowercase			:  Optional[int]   							=	0, 5




print(ford_fulkerson(graph, source, sink))





'''simple docstring'''







from __future__ import annotations






class 			lowerCAmelCase__       :






					def __init__(       self    ,							__SCREAMING_SNAKE_CASE = 0		):


											"""simple docstring"""





											lowercase_     :					Any													=	key






					def      _snake_case   (       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		):


											"""simple docstring"""





											assert isinstance(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		) and isinstance(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		)

											lowercase_     :					List[str]													=	key or self.__key or 1

											# make sure key is an appropriate size
											key %= 2_55

											return [chr(ord(__SCREAMING_SNAKE_CASE		) ^ key		) for ch in content]






					def      _snake_case   (       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		):


											"""simple docstring"""





											assert isinstance(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		) and isinstance(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		)

											lowercase_     :					Optional[int]													=	key or self.__key or 1

											# make sure key is an appropriate size
											key %= 2_55

											return [chr(ord(__SCREAMING_SNAKE_CASE		) ^ key		) for ch in content]






					def      _snake_case   (       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE = 0		):


											"""simple docstring"""





											assert isinstance(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		) and isinstance(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		)

											lowercase_     :					List[Any]													=	key or self.__key or 1

											# make sure key can be any size
											while key > 2_55:
																	key -= 2_55

											# This will be returned
											lowercase_     :					str													=	''''''

											for ch in content:
																	ans += chr(ord(__SCREAMING_SNAKE_CASE		) ^ key		)

											return ans






					def      _snake_case   (       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE = 0		):


											"""simple docstring"""





											assert isinstance(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		) and isinstance(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		)

											lowercase_     :					Any													=	key or self.__key or 1

											# make sure key can be any size
											while key > 2_55:
																	key -= 2_55

											# This will be returned
											lowercase_     :					Dict													=	''''''

											for ch in content:
																	ans += chr(ord(__SCREAMING_SNAKE_CASE		) ^ key		)

											return ans






					def      _snake_case   (       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE = 0		):


											"""simple docstring"""





											assert isinstance(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		) and isinstance(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		)

											try:
																	with open(__SCREAMING_SNAKE_CASE		) as fin, open('''encrypt.out'''    ,							'''w+'''		) as fout:
																							# actual encrypt-process
																							for line in fin:
																													fout.write(self.encrypt_string(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		)		)

											except OSError:
																	return False

											return True






					def      _snake_case   (       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		):


											"""simple docstring"""





											assert isinstance(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		) and isinstance(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		)

											try:
																	with open(__SCREAMING_SNAKE_CASE		) as fin, open('''decrypt.out'''    ,							'''w+'''		) as fout:
																							# actual encrypt-process
																							for line in fin:
																													fout.write(self.decrypt_string(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE		)		)

											except OSError:
																	return False

											return True


# Tests
# crypt = XORCipher()
# key = 67

# # test encrypt
# print(crypt.encrypt("hallo welt",key))
# # test decrypt
# print(crypt.decrypt(crypt.encrypt("hallo welt",key), key))

# # test encrypt_string
# print(crypt.encrypt_string("hallo welt",key))

# # test decrypt_string
# print(crypt.decrypt_string(crypt.encrypt_string("hallo welt",key),key))

# if (crypt.encrypt_file("test.txt",key)):
#       print("encrypt successful")
# else:
#       print("encrypt unsuccessful")

# if (crypt.decrypt_file("encrypt.out",key)):
#       print("decrypt successful")
# else:
#       print("decrypt unsuccessful")



