

"""simple docstring"""





_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],
]




def   _A  (  UpperCamelCase_     :       List[Any],			UpperCamelCase_     :       Optional[Any],			UpperCamelCase_     :       Tuple,			UpperCamelCase_     :       str)	->						Any:
   '''simple docstring'''


   __lowercase								=						[False] * len(UpperCamelCase_)
   __lowercase								=						[s]
   __lowercase								=						True

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

   return visited[t]




def   _A  (  UpperCamelCase_     :       int,			UpperCamelCase_     :       Tuple,			UpperCamelCase_     :       List[str])	->						Optional[int]:
   '''simple docstring'''


   __lowercase								=						[-1] * (len(UpperCamelCase_))
   __lowercase								=						0
   __lowercase								=						[]
   __lowercase								=						[i[:] for i in graph]  # Record original cut, copy.
   while bfs(UpperCamelCase_,			UpperCamelCase_,			UpperCamelCase_,			UpperCamelCase_):
      __lowercase								=						float("Inf")
      __lowercase								=						sink

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

      max_flow += path_flow
      __lowercase								=						sink

      while v != source:
         __lowercase								=						parent[v]
         graph[u][v] -= path_flow
         graph[v][u] += path_flow
         __lowercase								=						parent[v]

   for i in range(len(UpperCamelCase_)):
      for j in range(len(graph[0])):
         if graph[i][j] == 0 and temp[i][j] > 0:
            res.append((i, j))

   return res


if __name__ == "__main__":
   print(mincut(test_graph, source=0, sink=5))








"""simple docstring"""







from __future__ import annotations






class 						_A  :







    """simple docstring"""




    def __init__(					self				:    List[str]				, __UpperCAmelCase				:    int = 0):
      a						:		Tuple      							=			key






    def 	__snake_case							(					self				:    List[str]				, __UpperCAmelCase				:    str				, __UpperCAmelCase				:    int):
      assert isinstance(__UpperCAmelCase				, __UpperCAmelCase) and isinstance(__UpperCAmelCase				, __UpperCAmelCase)

      a						:		Dict      							=			key or self.__key or 1

      # make sure key is an appropriate size
      key %= 255

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






    def 	__snake_case							(					self				:    int				, __UpperCAmelCase				:    str				, __UpperCAmelCase				:    int):
      assert isinstance(__UpperCAmelCase				, __UpperCAmelCase) and isinstance(__UpperCAmelCase				, __UpperCAmelCase)

      a						:		Optional[Any]      							=			key or self.__key or 1

      # make sure key is an appropriate size
      key %= 255

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






    def 	__snake_case							(					self				:    Optional[Any]				, __UpperCAmelCase				:    str				, __UpperCAmelCase				:    int = 0):
      assert isinstance(__UpperCAmelCase				, __UpperCAmelCase) and isinstance(__UpperCAmelCase				, __UpperCAmelCase)

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

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

      # This will be returned
      a						:		Any      							=			""

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

      return ans






    def 	__snake_case							(					self				:    List[str]				, __UpperCAmelCase				:    str				, __UpperCAmelCase				:    int = 0):
      assert isinstance(__UpperCAmelCase				, __UpperCAmelCase) and isinstance(__UpperCAmelCase				, __UpperCAmelCase)

      a						:		Dict      							=			key or self.__key or 1

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

      # This will be returned
      a						:		str      							=			""

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

      return ans






    def 	__snake_case							(					self				:    int				, __UpperCAmelCase				:    str				, __UpperCAmelCase				:    int = 0):
      assert isinstance(__UpperCAmelCase				, __UpperCAmelCase) and isinstance(__UpperCAmelCase				, __UpperCAmelCase)

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

      except OSError:
        return False

      return True






    def 	__snake_case							(					self				:    Any				, __UpperCAmelCase				:    str				, __UpperCAmelCase				:    int):
      assert isinstance(__UpperCAmelCase				, __UpperCAmelCase) and isinstance(__UpperCAmelCase				, __UpperCAmelCase)

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

      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")






