





from __future__ import annotations





class UpperCAmelCase_							:


  def __init__(       self   ,__snake_case   ):



       """simple docstring"""





       A_					      =					vertices
       A_					      =					[[0] * vertices for _ in range(__snake_case   )]


  def 	__UpperCAmelCase    (       self   ,__snake_case   ):



       """simple docstring"""





       print('''Vertex \t Distance from Source'''   )
       for vertex in range(self.vertices   ):
            print(__snake_case   ,'''\t\t'''   ,distances_from_source[vertex]   )


  def 	__UpperCAmelCase    (       self   ,__snake_case   ,__snake_case   ):



       """simple docstring"""





       A_					      =					1E7
       A_					      =					0

       # Search not nearest vertex not in the shortest path tree
       for vertex in range(self.vertices   ):
            if distances_from_source[vertex] < minimum and visited[vertex] is False:
                 A_					      =					distances_from_source[vertex]
                 A_					      =					vertex
       return min_index




  def 	__UpperCAmelCase    (       self   ,__snake_case   ):



       """simple docstring"""





       A_					      =					[int(1E7   )] * self.vertices  # distances from the source
       A_					      =					0
       A_					      =					[False] * self.vertices

       for _ in range(self.vertices   ):
            A_					      =					self.minimum_distance(__snake_case   ,__snake_case   )
            A_					      =					True

            # Update dist value of the adjacent vertices
            # of the picked vertex only if the current
            # distance is greater than new distance and
            # the vertex in not in the shortest path tree
            for v in range(self.vertices   ):
                 if (
                     self.graph[u][v] > 0
                     and visited[v] is False
                     and distances[v] > distances[u] + self.graph[u][v]
                 ):
                      A_					      =					distances[u] + self.graph[u][v]

       self.print_solution(__snake_case   )


if __name__ == "__main__":
      a__			:    Any			      =		Graph(9)
      a__			:    Optional[Any]			      =		[
          [0, 4, 0, 0, 0, 0, 0, 8, 0],
          [4, 0, 8, 0, 0, 0, 0, 11, 0],
          [0, 8, 0, 7, 0, 4, 0, 0, 2],
          [0, 0, 7, 0, 9, 14, 0, 0, 0],
          [0, 0, 0, 9, 0, 10, 0, 0, 0],
          [0, 0, 4, 14, 10, 0, 2, 0, 0],
          [0, 0, 0, 0, 0, 2, 0, 1, 6],
          [8, 11, 0, 0, 0, 0, 1, 0, 7],
          [0, 0, 2, 0, 0, 0, 6, 7, 0],
      ]
      graph.dijkstra(0)










import itertools
from pathlib import Path

def     UpperCAmelCase_						(						_UpperCAmelCase       :list[str]							)  ->							int:
     '''simple docstring'''


     A_					      =					[tuple(_UpperCAmelCase							) for login in logins]

     A_					      =					{char for login in split_logins for char in login}

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

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

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

def     UpperCAmelCase_						(						_UpperCAmelCase       :str = "keylog.txt"							)  ->							int:
     '''simple docstring'''


     A_					      =					Path(_UpperCAmelCase							).parent.joinpath(_UpperCAmelCase							).read_text().splitlines()

     return find_secret_passcode(_UpperCAmelCase							)


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



