





"""simple docstring"""





def      UpperCAmelCase__				(    SCREAMING_SNAKE_CASE	:		Optional[Any]     ):







      '''simple docstring'''




      return [
          {
              0: [1, 2],
              1: [0, 2],
              2: [0, 1, 3, 5],
              3: [2, 4],
              4: [3],
              5: [2, 6, 8],
              6: [5, 7],
              7: [6, 8],
              8: [5, 7],
          },
          {
              0: [6],
              1: [9],
              2: [4, 5],
              3: [4],
              4: [2, 3],
              5: [2],
              6: [0, 7],
              7: [6],
              8: [],
              9: [1],
          },
          {
              0: [4],
              1: [6],
              2: [],
              3: [5, 6, 7],
              4: [0, 6],
              5: [3, 8, 9],
              6: [1, 3, 4, 7],
              7: [3, 6, 8, 9],
              8: [5, 7],
              9: [5, 7],
          },
          {
              0: [1, 3],
              1: [0, 2, 4],
              2: [1, 3, 4],
              3: [0, 2, 4],
              4: [1, 2, 3],
          },
      ][index]


def      UpperCAmelCase__				(    SCREAMING_SNAKE_CASE	:		dict[int, list[int]]     ):







      '''simple docstring'''




      lowerCAmelCase    		=			0
      lowerCAmelCase    		=			len(SCREAMING_SNAKE_CASE     )  # No of vertices in graph
      lowerCAmelCase    		=			[0] * n
      lowerCAmelCase    		=			[False] * n

      def dfs(SCREAMING_SNAKE_CASE	:		Optional[int]				,		SCREAMING_SNAKE_CASE	:		Any				,		SCREAMING_SNAKE_CASE	:		Optional[Any]				,		SCREAMING_SNAKE_CASE	:		Dict     ):
            lowerCAmelCase    		=			True
            lowerCAmelCase    		=			id_
            id_ += 1
            for to in graph[at]:
                  if to == parent:
                        pass
                  elif not visited[to]:
                        dfs(SCREAMING_SNAKE_CASE				,		SCREAMING_SNAKE_CASE				,		SCREAMING_SNAKE_CASE				,		id_     )
                        lowerCAmelCase    		=			min(low[at]				,		low[to]     )
                        if id_ <= low[to]:
                              bridges.append((at, to) if at < to else (to, at)     )
                  else:
                        # This edge is a back edge and cannot be a bridge
                        lowerCAmelCase    		=			min(low[at]				,		low[to]     )

      lowerCAmelCase    		=			[]
      for i in range(SCREAMING_SNAKE_CASE     ):
            if not visited[i]:
                  dfs(SCREAMING_SNAKE_CASE				,		-1				,		SCREAMING_SNAKE_CASE				,		id_     )
      return bridges


if __name__ == "__main__":
       import doctest

       doctest.testmod()













"""simple docstring"""





def      UpperCAmelCase__				(    SCREAMING_SNAKE_CASE	:		str     ):







      '''simple docstring'''




      lowerCAmelCase    		=			""""""
      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      UpperCAmelCase__				(    SCREAMING_SNAKE_CASE	:		str     ):







      '''simple docstring'''




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


def      UpperCAmelCase__				(    SCREAMING_SNAKE_CASE	:		str				,		SCREAMING_SNAKE_CASE	:		dict[str, str]     ):







      '''simple docstring'''




      return "".join(cipher_map.get(SCREAMING_SNAKE_CASE				,		SCREAMING_SNAKE_CASE     ) for ch in message.upper()     )


def      UpperCAmelCase__				(    SCREAMING_SNAKE_CASE	:		str				,		SCREAMING_SNAKE_CASE	:		dict[str, str]     ):







      '''simple docstring'''




      lowerCAmelCase    		=			{v: k for k, v in cipher_map.items()}
      return "".join(rev_cipher_map.get(SCREAMING_SNAKE_CASE				,		SCREAMING_SNAKE_CASE     ) for ch in message.upper()     )


def      UpperCAmelCase__				(    ):







      '''simple docstring'''




      lowerCAmelCase    		=			input("""Enter message to encode or decode: """     ).strip()
      lowerCAmelCase    		=			input("""Enter keyword: """     ).strip()
      lowerCAmelCase    		=			input("""Encipher or decipher? E/D:"""     ).strip()[0].lower()
      try:
            lowerCAmelCase    		=			{"""e""": encipher, """d""": decipher}[option]
      except KeyError:
            raise KeyError("""invalid input option"""     )
      lowerCAmelCase    		=			create_cipher_map(SCREAMING_SNAKE_CASE     )
      print(func(SCREAMING_SNAKE_CASE				,		SCREAMING_SNAKE_CASE     )     )


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       main()






