


'''simple docstring'''

lowercase__					  =		float("inf")





class     __SCREAMING_SNAKE_CASE       :






     def __init__(      self  ,				__UpperCamelCase		)							->     Any:
          _a            =		[0] * n
          _a            =		[0] * n
          _a            =		[0] * n
          _a            =		[[] for _ in range(__UpperCamelCase		)]






     def 			a_       (      self  ,				__UpperCamelCase  ,				__UpperCamelCase  ,				__UpperCamelCase  ,				__UpperCamelCase=0		)							->     List[Any]:
          self.adj[a].append([b, len(self.adj[b]		), c, 0]		)
          self.adj[b].append([a, len(self.adj[a]		) - 1, rcap, 0]		)






     def 			a_       (      self  ,				__UpperCamelCase  ,				__UpperCamelCase  ,				__UpperCamelCase		)							->     List[Any]:
          if vertex == sink or not flow:
               return flow

          for i in range(self.ptr[vertex]  ,				len(self.adj[vertex]		)		):
               _a            =		self.adj[vertex][i]
               if self.lvl[e[0]] == self.lvl[vertex] + 1:
                    _a            =		self.depth_first_search(e[0]  ,				__UpperCamelCase  ,				min(__UpperCamelCase  ,				e[2] - e[3]		)		)
                    if p:
                         self.adj[vertex][i][3] += p
                         self.adj[e[0]][e[1]][3] -= p
                         return p
               _a            =		self.ptr[vertex] + 1
          return 0






     def 			a_       (      self  ,				__UpperCamelCase  ,				__UpperCamelCase		)							->     List[str]:
          _a      ,      _a            =		0, source
          for l in range(31		):  # noqa: E741  l = 30 maybe faster for random data
               while True:
                    _a      ,      _a            =		[0] * len(self.q		), [0] * len(self.q		)
                    _a      ,      _a      ,      _a            =		0, 1, 1
                    while qi < qe and not self.lvl[sink]:
                         _a            =		self.q[qi]
                         qi += 1
                         for e in self.adj[v]:
                              if not self.lvl[e[0]] and (e[2] - e[3]) >> (30 - l):
                                   _a            =		e[0]
                                   qe += 1
                                   _a            =		self.lvl[v] + 1

                    _a            =		self.depth_first_search(__UpperCamelCase  ,				__UpperCamelCase  ,				__UpperCamelCase		)
                    while p:
                         flow += p
                         _a            =		self.depth_first_search(__UpperCamelCase  ,				__UpperCamelCase  ,				__UpperCamelCase		)

                    if not self.lvl[sink]:
                         break

          return flow
lowercase__					  =		Dinic(10)
lowercase__					  =		0
lowercase__					  =		9
for vertex in range(1, 5):
   graph.add_edge(source, vertex, 1)
for vertex in range(5, 9):
   graph.add_edge(vertex, sink, 1)
for vertex in range(1, 5):
   graph.add_edge(vertex, vertex + 4, 1)

# Now we can know that is the maximum flow(source -> sink)
print(graph.max_flow(source, sink))





'''simple docstring'''

import os
import sys
import time

from . import transposition_cipher as trans_cipher






def __UpperCamelCase (      )   ->  None:







     '''simple docstring'''






     _a            =		"Prehistoric Men.txt"
     _a            =		"Output.txt"
     _a            =		int(input("Enter key: "					)					)
     _a            =		input("Encrypt/Decrypt [e/d]: "					)

     if not os.path.exists(__lowerCamelCase					):
          print(F"File {input_file} does not exist. Quitting..."					)
          sys.exit()
     if os.path.exists(__lowerCamelCase					):
          print(F"Overwrite {output_file}? [y/n]"					)
          _a            =		input("> "					)
          if not response.lower().startswith("y"					):
               sys.exit()

     _a            =		time.time()
     if mode.lower().startswith("e"					):
          with open(__lowerCamelCase					) as f:
               _a            =		f.read()
          _a            =		trans_cipher.encrypt_message(__lowerCamelCase   ,	__lowerCamelCase					)
     elif mode.lower().startswith("d"					):
          with open(__lowerCamelCase					) as f:
               _a            =		f.read()
          _a            =		trans_cipher.decrypt_message(__lowerCamelCase   ,	__lowerCamelCase					)

     with open(__lowerCamelCase   ,	"w"					) as output_obj:
          output_obj.write(__lowerCamelCase					)

     _a            =		round(time.time() - start_time   ,	2					)
     print(("Done (", total_time, "seconds )")					)


if __name__ == "__main__":
   main()

