'''simple docstring'''
_A		:			Optional[Any]	      =float('''inf''')




class _lowerCAmelCase :







      def __init__(     self     ,						lowercase    ):
        lowercase							:       Optional[Any]											=      [0] * n
        lowercase							:       str											=      [0] * n
        lowercase							:       Union[str, Any]											=      [0] * n
        lowercase							:       Optional[int]											=      [[] for _ in range(lowercase    )]







      def     lowerCamelCase__			(     self     ,						lowercase     ,						lowercase     ,						lowercase     ,						lowercase=0    ):
        self.adj[a].append([b, len(self.adj[b]    ), c, 0]    )
        self.adj[b].append([a, len(self.adj[a]    ) - 1, rcap, 0]    )







      def     lowerCamelCase__			(     self     ,						lowercase     ,						lowercase     ,						lowercase    ):
        if vertex == sink or not flow:
          return flow

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







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

            lowercase							:       str											=      self.depth_first_search(lowercase     ,						lowercase     ,						lowercase    )
            while p:
              flow += p
              lowercase							:       Dict											=      self.depth_first_search(lowercase     ,						lowercase     ,						lowercase    )

            if not self.lvl[sink]:
              break

        return flow





_A		:			Any	      =Dinic(1_0)
_A		:			Optional[Any]	      =0
_A		:			Optional[Any]	      =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 itertools
from pathlib import Path







def 							__UpperCamelCase   (				__UpperCAmelCase     :				list[str] )       ->  int:
  lowercase							:       List[str]											=      [tuple(__UpperCAmelCase ) for login in logins]

  lowercase							:       List[Any]											=      {char for login in split_logins for char in login}

  for permutation in itertools.permutations(__UpperCAmelCase ):
    lowercase							:       List[str]											=      True
    for login in logins:
      if not (
          permutation.index(login[0] )
          < permutation.index(login[1] )
          < permutation.index(login[2] )
      ):
        lowercase							:       List[str]											=      False
        break

    if satisfied:
      return int(''''''.join(__UpperCAmelCase ) )

  raise Exception('''Unable to find the secret passcode''' )







def 							__UpperCamelCase   (				__UpperCAmelCase     :				str = "keylog.txt" )       ->  int:
  lowercase							:       Union[str, Any]											=      Path(__UpperCAmelCase ).parent.joinpath(__UpperCAmelCase ).read_text().splitlines()

  return find_secret_passcode(__UpperCAmelCase )


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