
__lowerCAmelCase      :					List[str]   	=       float('inf')




class 	UpperCAmelCase_      :


  '''simple docstring'''







  def __init__(			self      :			List[str]      ,							UpperCamelCase__      :			List[Any]   )      ->     Union[str, Any]:







    """simple docstring"""






    __magic_name__    					=	[0] * n
    __magic_name__    					=	[0] * n
    __magic_name__    					=	[0] * n
    __magic_name__    					=	[[] for _ in range(UpperCamelCase__   )]
  def 							_lowercase							(			self      :			Dict      ,							UpperCamelCase__      :			List[str]      ,							UpperCamelCase__      :			Dict      ,							UpperCamelCase__      :			Tuple      ,							UpperCamelCase__      :			Tuple=0   )      ->     Any:







    """simple docstring"""






    self.adj[a].append([b, len(self.adj[b]   ), c, 0]   )
    self.adj[b].append([a, len(self.adj[a]   ) - 1, rcap, 0]   )
  def 							_lowercase							(			self      :			Optional[int]      ,							UpperCamelCase__      :			List[Any]      ,							UpperCamelCase__      :			Tuple      ,							UpperCamelCase__      :			Union[str, Any]   )      ->     Union[str, Any]:







    """simple docstring"""






    if vertex == sink or not flow:
      return flow

    for i in range(self.ptr[vertex]      ,							len(self.adj[vertex]   )   ):
      __magic_name__    					=	self.adj[vertex][i]
      if self.lvl[e[0]] == self.lvl[vertex] + 1:
        __magic_name__    					=	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
      __magic_name__    					=	self.ptr[vertex] + 1
    return 0





  def 							_lowercase							(			self      :			Union[str, Any]      ,							UpperCamelCase__      :			List[Any]      ,							UpperCamelCase__      :			int   )      ->     str:







    """simple docstring"""






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

        __magic_name__    					=	self.depth_first_search(UpperCamelCase__      ,							UpperCamelCase__      ,							UpperCamelCase__   )
        while p:
          flow += p
          __magic_name__    					=	self.depth_first_search(UpperCamelCase__      ,							UpperCamelCase__      ,							UpperCamelCase__   )

        if not self.lvl[sink]:
          break

    return flow
__lowerCAmelCase      :					Union[str, Any]   	=       Dinic(10)
__lowerCAmelCase      :					List[str]   	=       0
__lowerCAmelCase      :					Dict   	=       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))



import sys

sys.set_int_max_str_digits(0)  # type: ignore

def a__   (	A_ ):






  '''simple docstring'''





  __magic_name__    					=	[0] * 11
  __magic_name__    					=	[0] * 11

  # mark last 9 numbers
  for _ in range(9 ):
    __magic_name__    					=	1
    __magic_name__    					=	number // 10
  # flag
  __magic_name__    					=	True

  # check last 9 numbers for pandigitality

  for x in range(9 ):
    if not check_last[x + 1]:
      __magic_name__    					=	False
  if not f:
    return f

  # mark first 9 numbers
  __magic_name__    					=	int(str(A_ )[:9] )

  for _ in range(9 ):
    __magic_name__    					=	1
    __magic_name__    					=	number // 10

  # check first 9 numbers for pandigitality

  for x in range(9 ):
    if not check_front[x + 1]:
      __magic_name__    					=	False
  return f

def a__   (	A_ ):






  '''simple docstring'''





  __magic_name__    					=	[0] * 11

  # mark last 9 numbers
  for _ in range(9 ):
    __magic_name__    					=	1
    __magic_name__    					=	number // 10
  # flag
  __magic_name__    					=	True

  # check last 9 numbers for pandigitality

  for x in range(9 ):
    if not check_last[x + 1]:
      __magic_name__    					=	False
  return f

def a__   (	):






  '''simple docstring'''





  __magic_name__    					=	1
  __magic_name__    					=	1
  __magic_name__    					=	2
  # temporary Fibonacci numbers

  __magic_name__    					=	1
  __magic_name__    					=	1
  __magic_name__    					=	2
  # temporary Fibonacci numbers mod 1e9

  # mod m=1e9, done for fast optimisation
  __magic_name__    					=	[0] * 1000000
  __magic_name__    					=	1000000000

  for x in range(1000000 ):
    __magic_name__    					=	(aa + ba) % m
    __magic_name__    					=	ba % m
    __magic_name__    					=	ca % m
    if checka(A_ ):
      __magic_name__    					=	1

  for x in range(1000000 ):
    __magic_name__    					=	a + b
    __magic_name__    					=	b
    __magic_name__    					=	c
    # perform check only if in tocheck
    if tocheck[x + 3] and check(A_ ):
      return x + 3  # first 2 already done
  return -1


if __name__ == "__main__":
    print(F'''{solution() = }''')

