




def 					lowerCamelCase_    (    SCREAMING_SNAKE_CASE   ):
			'''simple docstring'''
			for i in range(len(SCREAMING_SNAKE_CASE   ) - 1					,	0					,	-1   ):
						SCREAMING_SNAKE_CASE           =					False

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

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

						if not swapped:
									break
			return unsorted


if __name__ == "__main__":
		import doctest

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












from __future__ import annotations
def 					lowerCamelCase_    (    SCREAMING_SNAKE_CASE   ):
			'''simple docstring'''
			create_state_space_tree(SCREAMING_SNAKE_CASE					,	[]					,	0					,	[0 for i in range(len(SCREAMING_SNAKE_CASE   )   )]   )
def 					lowerCamelCase_    (    SCREAMING_SNAKE_CASE					,	SCREAMING_SNAKE_CASE					,	SCREAMING_SNAKE_CASE					,	SCREAMING_SNAKE_CASE					,	):
			'''simple docstring'''

			if index == len(SCREAMING_SNAKE_CASE   ):
						print(SCREAMING_SNAKE_CASE   )
						return

			for i in range(len(SCREAMING_SNAKE_CASE   )   ):
						if not index_used[i]:
									current_sequence.append(sequence[i]   )
									SCREAMING_SNAKE_CASE           =					True
									create_state_space_tree(SCREAMING_SNAKE_CASE					,	SCREAMING_SNAKE_CASE					,	index + 1					,	SCREAMING_SNAKE_CASE   )
									current_sequence.pop()
									SCREAMING_SNAKE_CASE           =					False
__A						:							list[int | str]							=  [3, 1, 2, 4]
generate_all_permutations(sequence)

__A						:							list[int | str]							=  ["A", "B", "C"]




generate_all_permutations(sequence_a)






