



'''simple docstring'''





def lowerCAmelCase    (__A):



     """simple docstring"""



     for i in range(len(__A) - 1    ,      0    ,      -1):
          _a           =    False

          for j in range(__A    ,      0    ,      -1):
               if unsorted[j] < unsorted[j - 1]:
                    _a    ,       _a           =    unsorted[j - 1], unsorted[j]
                    _a           =    True

          for j in range(__A):
               if unsorted[j] > unsorted[j + 1]:
                    _a    ,       _a           =    unsorted[j + 1], unsorted[j]
                    _a           =    True

          if not swapped:
               break
     return unsorted


if __name__ == "__main__":
  import doctest

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




import functools
from typing import Any


def 	lowerCamelCase					(	UpperCamelCase     :				str			,       UpperCamelCase     :				list[str]							)   ->    bool:

		# Validation
		if not isinstance(UpperCamelCase			,       UpperCamelCase							) or len(UpperCamelCase							) == 0:
				raise ValueError('the string should be not empty string'							)

		if not isinstance(UpperCamelCase			,       UpperCamelCase							) or not all(
		    isinstance(UpperCamelCase			,       UpperCamelCase							) and len(UpperCamelCase							) > 0 for item in words							):
				raise ValueError('the words should be a list of non-empty strings'							)

		# Build trie
		_lowerCamelCase				   =  {}
		_lowerCamelCase				   =  'WORD_KEEPER'

		for word in words:
				_lowerCamelCase				   =  trie
				for c in word:
						if c not in trie_node:
								_lowerCamelCase				   =  {}

						_lowerCamelCase				   =  trie_node[c]

				_lowerCamelCase				   =  True

		_lowerCamelCase				   =  len(UpperCamelCase							)

		# Dynamic programming method
		@functools.cache
		def is_breakable(UpperCamelCase     :				int							) -> bool:
				if index == len_string:
						return True

				_lowerCamelCase				   =  trie
				for i in range(UpperCamelCase			,       UpperCamelCase							):
						_lowerCamelCase				   =  trie_node.get(string[i]			,       UpperCamelCase							)

						if trie_node is None:
								return False

						if trie_node.get(UpperCamelCase			,       UpperCamelCase							) and is_breakable(i + 1							):
								return True

				return False

		return is_breakable(0							)


if __name__ == "__main__":
				import doctest

				doctest.testmod()