






def 				snake_case__							(							UpperCAmelCase							:  list       ):
    for i in range(len(UpperCAmelCase       ) - 1    ,			0    ,			-1       ):
        lowerCAmelCase__   :Dict      							=				False

        for j in range(UpperCAmelCase    ,			0    ,			-1       ):
            if unsorted[j] < unsorted[j - 1]:
                lowerCAmelCase__							,lowerCAmelCase__   :str      							=				unsorted[j - 1], unsorted[j]
                lowerCAmelCase__   :Optional[Any]      							=				True

        for j in range(UpperCAmelCase       ):
            if unsorted[j] > unsorted[j + 1]:
                lowerCAmelCase__							,lowerCAmelCase__   :Tuple      							=				unsorted[j + 1], unsorted[j]
                lowerCAmelCase__   :Optional[Any]      							=				True

        if not swapped:
            break
    return unsorted


if __name__ == "__main__":
 import doctest

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











def 				snake_case__							(							UpperCAmelCase							:  Tuple       ):
    lowerCAmelCase__   :List[Any]      							=				len(UpperCAmelCase       )
    for i in range(length - 1       ):
        lowerCAmelCase__   :Union[str, Any]      							=				i
        for k in range(i + 1    ,			UpperCAmelCase       ):
            if collection[k] < collection[least]:
                lowerCAmelCase__   :Any      							=				k
        if least != i:
            lowerCAmelCase__							,lowerCAmelCase__   :int      							=				(collection[i], collection[least])
    return collection


if __name__ == "__main__":
 _a    :   Optional[int]        =			input("""Enter numbers separated by a comma:\n""").strip()
 _a    :   Any        =			[int(item) for item in user_input.split(""",""")]
 print(selection_sort(unsorted))



