






'''simple docstring'''






def        _SCREAMING_SNAKE_CASE  (				A  :       str  )    -> str:







   """simple docstring"""
   __snake_case				:      Any     							= ''
   for ch in key:
      if ch == " " or ch not in key_no_dups and ch.isalpha():
         key_no_dups += ch
   return key_no_dups




def        _SCREAMING_SNAKE_CASE  (				A  :       str  )    -> dict[str, str]:







   """simple docstring"""
   __snake_case				:      Tuple     							= [chr(i + 65  ) for i in range(26  )]
   # Remove duplicate characters from key
   __snake_case				:      str     							= remove_duplicates(key.upper()  )
   __snake_case				:      Any     							= len(A  )
   # First fill cipher with key characters
   __snake_case				:      Tuple     							= {alphabet[i]: char for i, char in enumerate(A  )}
   # Then map remaining characters in alphabet to
   # the alphabet from the beginning
   for i in range(len(A  )  ,		26  ):
      __snake_case				:      Any     							= alphabet[i - offset]
      # Ensure we are not mapping letters to letters previously mapped
      while char in key:
         offset -= 1
         __snake_case				:      int     							= alphabet[i - offset]
      __snake_case				:      int     							= char
   return cipher_alphabet




def        _SCREAMING_SNAKE_CASE  (				A  :       str  ,		A  :       dict[str, str]  )    -> str:







   """simple docstring"""
   return "".join(cipher_map.get(A  ,		A  ) for ch in message.upper()  )




def        _SCREAMING_SNAKE_CASE  (				A  :       str  ,		A  :       dict[str, str]  )    -> str:







   """simple docstring"""
   __snake_case				:      List[Any]     							= {v: k for k, v in cipher_map.items()}
   return "".join(rev_cipher_map.get(A  ,		A  ) for ch in message.upper()  )




def        _SCREAMING_SNAKE_CASE  (				)    -> None:







   """simple docstring"""
   __snake_case				:      Any     							= input('Enter message to encode or decode: '  ).strip()
   __snake_case				:      str     							= input('Enter keyword: '  ).strip()
   __snake_case				:      List[Any]     							= input('Encipher or decipher? E/D:'  ).strip()[0].lower()
   try:
      __snake_case				:      Any     							= {'e': encipher, 'd': decipher}[option]
   except KeyError:
      raise KeyError('invalid input option'  )
   __snake_case				:      Optional[int]     							= create_cipher_map(A  )
   print(func(A  ,		A  )  )


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      main()







'''simple docstring'''






import math




class a_    :







   def __init__(self					,   __a=0)			->      Any:  # a graph with Node 0,1,...,N-1
      """simple docstring"""






      __snake_case				:      List[str]     							= n
      __snake_case				:      Tuple     							= [
          [math.inf for j in range(0					,   __a)] for i in range(0					,   __a)
      ]  # adjacency matrix for weight
      __snake_case				:      Union[str, Any]     							= [
          [math.inf for j in range(0					,   __a)] for i in range(0					,   __a)
      ]  # dp[i][j] stores minimum distance from i to j







   def     SCREAMING_SNAKE_CASE__					(self					,   __a					,   __a					,   __a)			->      Tuple:
      """simple docstring"""






      __snake_case				:      Union[str, Any]     							= w







   def     SCREAMING_SNAKE_CASE__					(self)			->      Tuple:
      """simple docstring"""






      for k in range(0					,   self.n):
         for i in range(0					,   self.n):
            for j in range(0					,   self.n):
               __snake_case				:      List[Any]     							= min(self.dp[i][j]					,   self.dp[i][k] + self.dp[k][j])







   def     SCREAMING_SNAKE_CASE__					(self					,   __a					,   __a)			->      Optional[int]:
      """simple docstring"""






      return self.dp[u][v]


if __name__ == "__main__":
      __A    	=   Graph(5)
      graph.add_edge(0, 2, 9)
      graph.add_edge(0, 4, 1_0)
      graph.add_edge(1, 3, 5)
      graph.add_edge(2, 3, 7)
      graph.add_edge(3, 0, 1_0)
      graph.add_edge(3, 1, 2)
      graph.add_edge(3, 2, 1)
      graph.add_edge(3, 4, 6)
      graph.add_edge(4, 1, 3)
      graph.add_edge(4, 2, 4)
      graph.add_edge(4, 3, 9)
      graph.floyd_warshall()
      graph.show_min(1, 4)
      graph.show_min(0, 3)