code: 
  
  """simple docstring"""
  from __future__ import annotations
  
  
  
  
  def 				a__	(	lowerCAmelCase ,  lowerCAmelCase						)  ->   list[int]:
        assert len(lowerCAmelCase						) == len(lowerCAmelCase						)
  
        UpperCAmelCase__ :       str						=						len(lowerCAmelCase						)
        UpperCAmelCase__ :       Any						=						list(range(lowerCAmelCase						)						)
        UpperCAmelCase__ :       Tuple						=						[-1] * n  # who the donor has donated to
        UpperCAmelCase__ :       Any						=						[-1] * n  # who the recipient has received from
        UpperCAmelCase__ :       int						=						[0] * n
  
        while unmatched_donors:
              UpperCAmelCase__ :       Optional[Any]						=						unmatched_donors[0]
              UpperCAmelCase__ :       str						=						donor_pref[donor]
              UpperCAmelCase__ :       List[Any]						=						donor_preference[num_donations[donor]]
              num_donations[donor] += 1
              UpperCAmelCase__ :       Union[str, Any]						=						recipient_pref[recipient]
              UpperCAmelCase__ :       Optional[Any]						=						rec_record[recipient]
  
              if prev_donor != -1:
                    if rec_preference.index(lowerCAmelCase						) > rec_preference.index(lowerCAmelCase						):
                          UpperCAmelCase__ :       Optional[Any]						=						donor
                          UpperCAmelCase__ :       int						=						recipient
                          unmatched_donors.append(lowerCAmelCase						)
                          unmatched_donors.remove(lowerCAmelCase						)
              else:
                    UpperCAmelCase__ :       Union[str, Any]						=						donor
                    UpperCAmelCase__ :       str						=						recipient
                    unmatched_donors.remove(lowerCAmelCase						)
        return donor_record
  
  
style_context: 
  
  """simple docstring"""
  def 				a__	(	lowerCAmelCase ,  lowerCAmelCase						)  ->   str:
        if not isinstance(lowerCAmelCase ,  lowerCAmelCase						):
              raise TypeError("""plaintext must be a string"""						)
        if not isinstance(lowerCAmelCase ,  lowerCAmelCase						):
              raise TypeError("""key must be a string"""						)
  
        if not plaintext:
              raise ValueError("""plaintext is empty"""						)
        if not key:
              raise ValueError("""key is empty"""						)
  
        key += plaintext
        UpperCAmelCase__ :       Dict						=						plaintext.lower()
        UpperCAmelCase__ :       Tuple						=						key.lower()
        UpperCAmelCase__ :       Optional[int]						=						0
        UpperCAmelCase__ :       Tuple						=						0
        UpperCAmelCase__ :       Optional[int]						=						""""""
        while plaintext_iterator < len(lowerCAmelCase						):
              if (
                  ord(plaintext[plaintext_iterator]						) < 97
                  or ord(plaintext[plaintext_iterator]						) > 1_22
              ):
                    ciphertext += plaintext[plaintext_iterator]
                    plaintext_iterator += 1
              elif ord(key[key_iterator]						) < 97 or ord(key[key_iterator]						) > 1_22:
                    key_iterator += 1
              else:
                    ciphertext += chr(
                        (
                            (ord(plaintext[plaintext_iterator]						) - 97 + ord(key[key_iterator]						))
                            - 97
                        )
                        % 26
                        + 97						)
                    key_iterator += 1
                    plaintext_iterator += 1
        return ciphertext
  
  
  
  
  def 				a__	(	lowerCAmelCase ,  lowerCAmelCase						)  ->   str:
        if not isinstance(lowerCAmelCase ,  lowerCAmelCase						):
              raise TypeError("""ciphertext must be a string"""						)
        if not isinstance(lowerCAmelCase ,  lowerCAmelCase						):
              raise TypeError("""key must be a string"""						)
  
        if not ciphertext:
              raise ValueError("""ciphertext is empty"""						)
        if not key:
              raise ValueError("""key is empty"""						)
  
        UpperCAmelCase__ :       Union[str, Any]						=						key.lower()
        UpperCAmelCase__ :       int						=						0
        UpperCAmelCase__ :       int						=						0
        UpperCAmelCase__ :       int						=						""""""
        while ciphertext_iterator < len(lowerCAmelCase						):
              if (
                  ord(ciphertext[ciphertext_iterator]						) < 97
                  or ord(ciphertext[ciphertext_iterator]						) > 1_22
              ):
                    plaintext += ciphertext[ciphertext_iterator]
              else:
                    plaintext += chr(
                        (ord(ciphertext[ciphertext_iterator]						) - ord(key[key_iterator]						)) % 26
                        + 97						)
                    key += chr(
                        (ord(ciphertext[ciphertext_iterator]						) - ord(key[key_iterator]						)) % 26
                        + 97						)
                    key_iterator += 1
              ciphertext_iterator += 1
        return plaintext
  
  
  if __name__ == "__main__":
      import doctest
  
      doctest.testmod()
      _A						=     int(input("""Type 1 to encrypt or 2 to decrypt:"""))
      if operation == 1:
          _A						=     input("""Typeplaintext to be encrypted:\n""")
          _A						=     input("""Type the key:\n""")
          print(encrypt(plaintext, key))
      elif operation == 2:
          _A						=     input("""Type the ciphertext to be decrypted:\n""")
          _A						=     input("""Type the key:\n""")
          print(decrypt(ciphertext, key))
      decrypt("""jsqqs avvwo""", """coffee""")
  
  