

def    A_  (							a  ):

      """simple docstring"""



      SCREAMING_SNAKE_CASE_				:  Optional[int]           =     ''
      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    A_  (							a  ):

      """simple docstring"""



      SCREAMING_SNAKE_CASE_				:  List[Any]           =     [chr(i + 6_5  ) for i in range(2_6  )]
      # Remove duplicate characters from key
      SCREAMING_SNAKE_CASE_				:  Tuple           =     remove_duplicates(key.upper()  )
      SCREAMING_SNAKE_CASE_				:  Tuple           =     len(a  )
      # First fill cipher with key characters
      SCREAMING_SNAKE_CASE_				:  str           =     {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  )					,   2_6  ):
            SCREAMING_SNAKE_CASE_				:  Tuple           =     alphabet[i - offset]
            # Ensure we are not mapping letters to letters previously mapped
            while char in key:
                  offset -= 1
                  SCREAMING_SNAKE_CASE_				:  str           =     alphabet[i - offset]
            SCREAMING_SNAKE_CASE_				:  Tuple           =     char
      return cipher_alphabet

def    A_  (							a					,   a  ):

      """simple docstring"""



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

def    A_  (							a					,   a  ):

      """simple docstring"""



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

def    A_  (							):

      """simple docstring"""



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


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    main()









def    A_  (							a					,   a  ):

      """simple docstring"""



      return int((input_a, input_a).count(0  ) != 0  )

def    A_  (							):

      """simple docstring"""



      assert nand_gate(0					,   0  ) == 1
      assert nand_gate(0					,   1  ) == 1
      assert nand_gate(1					,   0  ) == 1
      assert nand_gate(1					,   1  ) == 0


if __name__ == "__main__":
    print(nand_gate(0, 0))
    print(nand_gate(0, 1))
    print(nand_gate(1, 0))
    print(nand_gate(1, 1))






