



"""simple docstring"""







def  __SCREAMING_SNAKE_CASE (  __UpperCAmelCase   ,				__UpperCAmelCase      ):
		if not isinstance(__UpperCAmelCase   ,				__UpperCAmelCase      ):
				raise TypeError("""plaintext must be a string"""      )
		if not isinstance(__UpperCAmelCase   ,				__UpperCAmelCase      ):
				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
		_lowercase				: List[str]     =   plaintext.lower()
		_lowercase				: str     =   key.lower()
		_lowercase				: Any     =   0
		_lowercase				: int     =   0
		_lowercase				: Any     =   """"""
		while plaintext_iterator < len(__UpperCAmelCase      ):
				if (
				    ord(plaintext[plaintext_iterator]      ) < 97
				    or ord(plaintext[plaintext_iterator]      ) > 122
				):
						ciphertext += plaintext[plaintext_iterator]
						plaintext_iterator += 1
				elif ord(key[key_iterator]      ) < 97 or ord(key[key_iterator]      ) > 122:
						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  __SCREAMING_SNAKE_CASE (  __UpperCAmelCase   ,				__UpperCAmelCase      ):
		if not isinstance(__UpperCAmelCase   ,				__UpperCAmelCase      ):
				raise TypeError("""ciphertext must be a string"""      )
		if not isinstance(__UpperCAmelCase   ,				__UpperCAmelCase      ):
				raise TypeError("""key must be a string"""      )

		if not ciphertext:
				raise ValueError("""ciphertext is empty"""      )
		if not key:
				raise ValueError("""key is empty"""      )

		_lowercase				: Dict     =   key.lower()
		_lowercase				: str     =   0
		_lowercase				: Dict     =   0
		_lowercase				: Optional[Any]     =   """"""
		while ciphertext_iterator < len(__UpperCAmelCase      ):
				if (
				    ord(ciphertext[ciphertext_iterator]      ) < 97
				    or ord(ciphertext[ciphertext_iterator]      ) > 122
				):
						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()
		UpperCAmelCase:  Any			     =				int(input("""Type 1 to encrypt or 2 to decrypt:"""))
		if operation == 1:
				UpperCAmelCase:  Any			     =				input("""Typeplaintext to be encrypted:\n""")
				UpperCAmelCase:  Dict			     =				input("""Type the key:\n""")
				print(encrypt(plaintext, key))
		elif operation == 2:
				UpperCAmelCase:  List[str]			     =				input("""Type the ciphertext to be decrypted:\n""")
				UpperCAmelCase:  Any			     =				input("""Type the key:\n""")
				print(decrypt(ciphertext, key))
		decrypt("""jsqqs avvwo""", """coffee""")








'''simple docstring'''






def        snake_case_   (	lowerCAmelCase_			,  lowerCAmelCase_						)->						Union[str, Any]:





       '''simple docstring'''


       if n < 0:
              return 0
       # table[i] represents the number of ways to get to amount i
       _UpperCAmelCase    :		Union[str, Any]     	=					[0] * (n + 1)

       # There is exactly 1 way to get to zero(You pick no coins).
       _UpperCAmelCase    :		Optional[int]     	=					1

       # Pick all coins one by one and update table[] values
       # after the index greater than or equal to the value of the
       # picked coin
       for coin_val in s:
              for j in range(lowerCAmelCase_			,  n + 1						):
                     table[j] += table[j - coin_val]

       return table[n]


if __name__ == "__main__":
   import doctest

   doctest.testmod()



