






class 						lowerCAmelCase   :

					'''simple docstring'''

					def __init__(     self :		List[str]							)	->     int:


												"""simple docstring"""

												__lowercase					:							Tuple			=   """"""
												__lowercase					:							Tuple			=   """"""
												__lowercase					:							Dict			=   []



					def 					lowerCAmelCase (     self :		List[str]						,   __a :		int						,   __a :		int							)	->     int:


												"""simple docstring"""

												if m == -1:
																			return n + 1
												elif n == -1:
																			return m + 1
												elif self.dp[m][n] > -1:
																			return self.dp[m][n]
												else:
																			if self.worda[m] == self.worda[n]:
																										__lowercase					:							Union[str, Any]			=   self.__min_dist_top_down_dp(m - 1						,   n - 1							)
																			else:
																										__lowercase					:							str			=   self.__min_dist_top_down_dp(__a						,   n - 1							)
																										__lowercase					:							Optional[Any]			=   self.__min_dist_top_down_dp(m - 1						,   __a							)
																										__lowercase					:							Optional[int]			=   self.__min_dist_top_down_dp(m - 1						,   n - 1							)
																										__lowercase					:							Any			=   1 + min(__a						,   __a						,   __a							)

																			return self.dp[m][n]



					def 					lowerCAmelCase (     self :		Optional[int]						,   __a :		str						,   __a :		str							)	->     int:


												"""simple docstring"""

												__lowercase					:							Optional[int]			=   worda
												__lowercase					:							Union[str, Any]			=   worda
												__lowercase					:							Union[str, Any]			=   [[-1 for _ in range(len(__a							)							)] for _ in range(len(__a							)							)]

												return self.__min_dist_top_down_dp(len(__a							) - 1						,   len(__a							) - 1							)



					def 					lowerCAmelCase (     self :		Optional[Any]						,   __a :		str						,   __a :		str							)	->     int:


												"""simple docstring"""

												__lowercase					:							int			=   worda
												__lowercase					:							Union[str, Any]			=   worda
												__lowercase					:							List[Any]			=   len(__a							)
												__lowercase					:							Tuple			=   len(__a							)
												__lowercase					:							int			=   [[0 for _ in range(n + 1							)] for _ in range(m + 1							)]

												for i in range(m + 1							):
																			for j in range(n + 1							):
																										if i == 0:  # first string is empty
																																	__lowercase					:							Dict			=   j
																										elif j == 0:  # second string is empty
																																	__lowercase					:							int			=   i
																										elif worda[i - 1] == worda[j - 1]:  # last characters are equal
																																	__lowercase					:							str			=   self.dp[i - 1][j - 1]
																										else:
																																	__lowercase					:							List[Any]			=   self.dp[i][j - 1]
																																	__lowercase					:							Optional[int]			=   self.dp[i - 1][j]
																																	__lowercase					:							Dict			=   self.dp[i - 1][j - 1]
																																	__lowercase					:							str			=   1 + min(__a						,   __a						,   __a							)
												return self.dp[m][n]


if __name__ == "__main__":
	lowerCamelCase       :       Dict        =				EditDistance()

	print('''****************** Testing Edit Distance DP Algorithm ******************''')
	print()

	lowerCamelCase       :       Tuple        =				input('''Enter the first string: ''').strip()
	lowerCamelCase       :       str        =				input('''Enter the second string: ''').strip()

	print()
	print(f'''The minimum edit distance is: {solver.min_dist_top_down(Sa, Sa)}''')
	print(f'''The minimum edit distance is: {solver.min_dist_bottom_up(Sa, Sa)}''')
	print()
	print('''*************** End of Testing Edit Distance DP Algorithm ***************''')







lowerCamelCase       :       Optional[Any]        =				'''ABCDEFGHIJKLMNOPQRSTUVWXYZ'''
def 					snake_case_						(   ):
							__lowercase					:							List[str]			=   input("""Enter message: """					)
							__lowercase					:							int			=   input("""Enter key [alphanumeric]: """					)
							__lowercase					:							Optional[Any]			=   input("""Encrypt/Decrypt [e/d]: """					)

							if mode.lower().startswith("""e"""					):
														__lowercase					:							Optional[int]			=   """encrypt"""
														__lowercase					:							Dict			=   encrypt_message(lowerCAmelCase_				,				lowerCAmelCase_					)
							elif mode.lower().startswith("""d"""					):
														__lowercase					:							Union[str, Any]			=   """decrypt"""
														__lowercase					:							Optional[int]			=   decrypt_message(lowerCAmelCase_				,				lowerCAmelCase_					)

							print(F"\n{mode.title()}ed message:"					)
							print(lowerCAmelCase_					)
def 					snake_case_						(   lowerCAmelCase_				:  str				,				lowerCAmelCase_				:  str					):
							return translate_message(lowerCAmelCase_				,				lowerCAmelCase_				,				"""encrypt"""					)
def 					snake_case_						(   lowerCAmelCase_				:  str				,				lowerCAmelCase_				:  str					):
							return translate_message(lowerCAmelCase_				,				lowerCAmelCase_				,				"""decrypt"""					)
def 					snake_case_						(   lowerCAmelCase_				:  str				,				lowerCAmelCase_				:  str				,				lowerCAmelCase_				:  str					):
							__lowercase					:							Union[str, Any]			=   []
							__lowercase					:							Tuple			=   0
							__lowercase					:							Dict			=   key.upper()

							for symbol in message:
														__lowercase					:							Optional[Any]			=   LETTERS.find(symbol.upper()					)
														if num != -1:
																					if mode == "encrypt":
																												num += LETTERS.find(key[key_index]					)
																					elif mode == "decrypt":
																												num -= LETTERS.find(key[key_index]					)

																					num %= len(lowerCAmelCase_					)

																					if symbol.isupper():
																												translated.append(LETTERS[num]					)
																					elif symbol.islower():
																												translated.append(LETTERS[num].lower()					)

																					key_index += 1
																					if key_index == len(lowerCAmelCase_					):
																												__lowercase					:							str			=   0
														else:
																					translated.append(lowerCAmelCase_					)
							return "".join(lowerCAmelCase_					)


if __name__ == "__main__":
	main()