


_A									=		float('inf')






class        UpperCAmelCase__			:



    """simple docstring"""






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






    def _a   (     self   ,  A_   ,  A_   ,  A_   ,  A_=0       )    ->			Dict:
         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   ,  A_   ,  A_   ,  A_       )    ->			Dict:
         if vertex == sink or not flow:
              return flow

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






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

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

                   if not self.lvl[sink]:
                        break

         return flow
_A									=		Dinic(10)
_A									=		0
_A									=		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))






from ..utils import DummyObject, requires_backends





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  int		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  int		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  int		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)