






"""simple docstring"""






def       _A    (__a							)				-> list:
    """simple docstring"""






    for i in range(len(__a							) - 1					,       0					,       -1							):
        SCREAMING_SNAKE_CASE_   :						Dict							=	False

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

        for j in range(__a							):
            if unsorted[j] > unsorted[j + 1]:
                SCREAMING_SNAKE_CASE_		,    SCREAMING_SNAKE_CASE_   :						Any							=	unsorted[j + 1], unsorted[j]
                SCREAMING_SNAKE_CASE_   :						List[Any]							=	True

        if not swapped:
            break
    return unsorted


if __name__ == "__main__":
  import doctest

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










"""simple docstring"""






# Algorithm for the pigeonhole sorting





def       _A    (__a							)				-> Dict:
    """simple docstring"""






    SCREAMING_SNAKE_CASE_   :						Dict							=	min(__a							)  # min() finds the minimum value
    SCREAMING_SNAKE_CASE_   :						int							=	max(__a							)  # max() finds the maximum value

    SCREAMING_SNAKE_CASE_   :						Dict							=	max_val - min_val + 1  # size is difference of max and min values plus one

    # list of pigeonholes of size equal to the variable size
    SCREAMING_SNAKE_CASE_   :						Any							=	[0] * size

    # Populate the pigeonholes.
    for x in a:
        assert isinstance(__a					,       __a							), "integers only please"
        holes[x - min_val] += 1

    # Putting the elements back into the array in an order.
    SCREAMING_SNAKE_CASE_   :						Any							=	0
    for count in range(__a							):
        while holes[count] > 0:
            holes[count] -= 1
            SCREAMING_SNAKE_CASE_   :						Dict							=	count + min_val
            i += 1



def       _A    ()				-> Optional[int]:
    """simple docstring"""






    SCREAMING_SNAKE_CASE_   :						List[str]							=	[8, 3, 2, 7, 4, 6, 8]
    pigeonhole_sort(__a							)
    print('''Sorted order is:'''					,       ''' '''.join(__a							)							)


if __name__ == "__main__":
  main()


