'''simple docstring'''
from __future__ import annotations







def 							__UpperCamelCase   (				__UpperCAmelCase     :				int   ,      __UpperCAmelCase     :				int   ,      __UpperCAmelCase     :				int )       ->  int:
  assert n > 1 and a > 0 and greatest_common_divisor(__UpperCAmelCase   ,      __UpperCAmelCase ) == 1
  (lowercase)							:       Optional[Any]											=      extended_gcd(__UpperCAmelCase   ,      __UpperCAmelCase )  # Implemented below
  lowercase							:       int											=      (b * s) % n
  return x







def 							__UpperCamelCase   (				__UpperCAmelCase     :				int   ,      __UpperCAmelCase     :				int )       ->  int:
  (lowercase)							:       str											=      extended_euclid(__UpperCAmelCase   ,      __UpperCAmelCase )  # Implemented below
  if b < 0:
    lowercase							:       List[Any]											=      (b % n + n) % n
  return b







def 							__UpperCamelCase   (				__UpperCAmelCase     :				int   ,      __UpperCAmelCase     :				int   ,      __UpperCAmelCase     :				int )       ->  int:
  lowercase							:       str											=      invert_modulo(__UpperCAmelCase   ,      __UpperCAmelCase )
  lowercase							:       str											=      (b * s) % n
  return x







def 							__UpperCamelCase   (				__UpperCAmelCase     :				int   ,      __UpperCAmelCase     :				int )       ->  tuple[int, int, int]:
  assert a >= 0 and b >= 0

  if b == 0:
    lowercase							:       int											=      a, 1, 0
  else:
    (lowercase)							:       Dict											=      extended_gcd(__UpperCAmelCase   ,      a % b )
    lowercase							:       Optional[int]											=      q
    lowercase							:       Optional[Any]											=      p - q * (a // b)

  assert a % d == 0 and b % d == 0
  assert d == a * x + b * y

  return (d, x, y)







def 							__UpperCamelCase   (				__UpperCAmelCase     :				int   ,      __UpperCAmelCase     :				int )       ->  tuple[int, int]:
  if b == 0:
    return (1, 0)
  (lowercase)							:       List[Any]											=      extended_euclid(__UpperCAmelCase   ,      a % b )
  lowercase							:       Optional[int]											=      a // b
  return (y, x - k * y)







def 							__UpperCamelCase   (				__UpperCAmelCase     :				int   ,      __UpperCAmelCase     :				int )       ->  int:
  if a < b:
    lowercase							:       Tuple											=      b, a

  while a % b != 0:
    lowercase							:       Any											=      b, a % b

  return b


if __name__ == "__main__":
 from doctest import testmod

 testmod(name='''modular_division''', verbose=True)
 testmod(name='''modular_division2''', verbose=True)
 testmod(name='''invert_modulo''', verbose=True)
 testmod(name='''extended_gcd''', verbose=True)
 testmod(name='''extended_euclid''', verbose=True)
 testmod(name='''greatest_common_divisor''', verbose=True)




'''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() = }""")