






def 					snake_case_						(   lowerCAmelCase_				:  list				,				lowerCAmelCase_				:  int = 0					):
							__lowercase					:							List[Any]			=   length or len(lowerCAmelCase_					)
							__lowercase					:							List[Any]			=   False
							for i in range(length - 1					):
														if list_data[i] > list_data[i + 1]:
																					__lowercase	,	__lowercase					:							List[str]			=   list_data[i + 1], list_data[i]
																					__lowercase					:							List[str]			=   True

							return list_data if not swapped else bubble_sort(lowerCAmelCase_				,				length - 1					)


if __name__ == "__main__":
	import doctest

	doctest.testmod()







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()