



"""simple docstring"""
from typing import Literal

__SCREAMING_SNAKE_CASE     :  Any										=					'''ABCDEFGHIJKLMNOPQRSTUVWXYZ'''



def 				lowerCAmelCase_(      lowercase_   :							str  ,      lowercase_   :							str  ,      lowercase_   :							Literal["encrypt", "decrypt"]							)		->				str:
				_lowerCamelCase					     = LETTERS if mode == '''decrypt''' else key
				_lowerCamelCase					     = key if mode == '''decrypt''' else LETTERS
				_lowerCamelCase					     = ''''''
				# loop through each symbol in the message
				for symbol in message:
								if symbol.upper() in chars_a:
												# encrypt/decrypt the symbol
												_lowerCamelCase					     = chars_a.find(symbol.upper()							)
												if symbol.isupper():
																translated += chars_b[sym_index].upper()
												else:
																translated += chars_b[sym_index].lower()
								else:
												# symbol is not in LETTERS, just add it
												translated += symbol
				return translated



def 				lowerCAmelCase_(      lowercase_   :							str  ,      lowercase_   :							str							)		->				str:
				return translate_message(lowercase_  ,      lowercase_  ,      '''encrypt'''							)



def 				lowerCAmelCase_(      lowercase_   :							str  ,      lowercase_   :							str							)		->				str:
				return translate_message(lowercase_  ,      lowercase_  ,      '''decrypt'''							)



def 				lowerCAmelCase_(      )		->				None:
				_lowerCamelCase					     = '''Hello World'''
				_lowerCamelCase					     = '''QWERTYUIOPASDFGHJKLZXCVBNM'''
				_lowerCamelCase					     = '''decrypt'''  # set to 'encrypt' or 'decrypt'

				if mode == "encrypt":
								_lowerCamelCase					     = encrypt_message(lowercase_  ,      lowercase_							)
				elif mode == "decrypt":
								_lowerCamelCase					     = decrypt_message(lowercase_  ,      lowercase_							)
				print(F"""Using the key {key}, the {mode}ed message is: {translated}"""							)


if __name__ == "__main__":
			import doctest

			doctest.testmod()
			main()





"""simple docstring"""
def 				lowerCAmelCase_(      lowercase_   :							str  ,      lowercase_   :							str							)		->				int:
				# The longer word should come first
				if len(lowercase_							) < len(lowercase_							):
								return levenshtein_distance(lowercase_  ,      lowercase_							)

				if len(lowercase_							) == 0:
								return len(lowercase_							)

				_lowerCamelCase					     = list(range(len(lowercase_							) + 1							)							)

				for i, ca in enumerate(lowercase_							):
								_lowerCamelCase					     = [i + 1]

								for j, ca in enumerate(lowercase_							):
												# Calculate insertions, deletions and substitutions
												_lowerCamelCase					     = previous_row[j + 1] + 1
												_lowerCamelCase					     = current_row[j] + 1
												_lowerCamelCase					     = previous_row[j] + (ca != ca)

												# Get the minimum to append to the current row
												current_row.append(min(lowercase_  ,      lowercase_  ,      lowercase_							)							)

								# Store the previous row
								_lowerCamelCase					     = current_row

				# Returns the last element (distance)
				return previous_row[-1]


if __name__ == "__main__":
			__SCREAMING_SNAKE_CASE     :  int										=					input('''Enter the first word:\n''').strip()
			__SCREAMING_SNAKE_CASE     :  Optional[Any]										=					input('''Enter the second word:\n''').strip()

			__SCREAMING_SNAKE_CASE     :  Optional[Any]										=					levenshtein_distance(first_word, second_word)
			print(F"""Levenshtein distance between {first_word} and {second_word} is {result}""")
