

'''simple docstring'''
def  a__       (    _SCREAMING_SNAKE_CASE   :       list				)     ->					list:


	"""simple docstring"""





	for i in range(len(_SCREAMING_SNAKE_CASE				) - 1	,				0	,				-1				):
		UpperCAmelCase_     :      Optional[Any]						=  False

		for j in range(_SCREAMING_SNAKE_CASE	,				0	,				-1				):
			if unsorted[j] < unsorted[j - 1]:
				UpperCAmelCase_					,					UpperCAmelCase_     :      Tuple						=  unsorted[j - 1], unsorted[j]
				UpperCAmelCase_     :      Union[str, Any]						=  True

		for j in range(_SCREAMING_SNAKE_CASE				):
			if unsorted[j] > unsorted[j + 1]:
				UpperCAmelCase_					,					UpperCAmelCase_     :      str						=  unsorted[j + 1], unsorted[j]
				UpperCAmelCase_     :      Optional[int]						=  True

		if not swapped:
			break
	return unsorted


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					_lowerCamelCase      					=     input("""Enter numbers separated by a comma:\n""").strip()
					_lowerCamelCase      					=     [int(item) for item in user_input.split(""",""")]
					print(f"""{cocktail_shaker_sort(unsorted) = }""")







"""simple docstring"""
_A							=  """ABCDEFGHIJKLMNOPQRSTUVWXYZ"""




def 					a__						(						)	-> None:
      UpperCAmelCase__			:							Optional[Any]							=    input("""Enter message: """    )
      UpperCAmelCase__			:							Optional[Any]							=    input("""Enter key [alphanumeric]: """    )
      UpperCAmelCase__			:							Optional[Any]							=    input("""Encrypt/Decrypt [e/d]: """    )

      if mode.lower().startswith("""e"""    ):
            UpperCAmelCase__			:							Optional[Any]							=    """encrypt"""
            UpperCAmelCase__			:							List[Any]							=    encrypt_message(lowerCAmelCase			,	lowerCAmelCase    )
      elif mode.lower().startswith("""d"""    ):
            UpperCAmelCase__			:							Optional[Any]							=    """decrypt"""
            UpperCAmelCase__			:							Dict							=    decrypt_message(lowerCAmelCase			,	lowerCAmelCase    )

      print(F"""\n{mode.title()}ed message:"""    )
      print(lowerCAmelCase    )




def 					a__						(						lowerCAmelCase			,	lowerCAmelCase    )	-> str:
      return translate_message(lowerCAmelCase			,	lowerCAmelCase			,	"""encrypt"""    )




def 					a__						(						lowerCAmelCase			,	lowerCAmelCase    )	-> str:
      return translate_message(lowerCAmelCase			,	lowerCAmelCase			,	"""decrypt"""    )




def 					a__						(						lowerCAmelCase			,	lowerCAmelCase			,	lowerCAmelCase    )	-> str:
      UpperCAmelCase__			:							Optional[Any]							=    []
      UpperCAmelCase__			:							int							=    0
      UpperCAmelCase__			:							str							=    key.upper()

      for symbol in message:
            UpperCAmelCase__			:							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    ):
                        UpperCAmelCase__			:							List[str]							=    0
            else:
                  translated.append(lowerCAmelCase    )
      return "".join(lowerCAmelCase    )


if __name__ == "__main__":
    main()

