





"""simple docstring"""



a_			=      {0: [2, 3], 1: [0], 2: [1], 3: [4], 4: []}

a_			=      {0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]}







def 		__lowercase					(       snake_case_  :  dict[int, list[int]]    ,snake_case_  :  int    ,snake_case_  :  list[bool]						)       ->list[int]:



    '''simple docstring'''







    __A   :						Tuple									=					True
    __A   :						Optional[Any]									=					[]

    for neighbour in graph[vert]:
        if not visited[neighbour]:
            order += topology_sort(snake_case_    ,snake_case_    ,snake_case_						)

    order.append(snake_case_						)

    return order







def 		__lowercase					(       snake_case_  :  dict[int, list[int]]    ,snake_case_  :  int    ,snake_case_  :  list[bool]						)       ->list[int]:



    '''simple docstring'''







    __A   :						int									=					True
    __A   :						List[Any]									=					[vert]

    for neighbour in reversed_graph[vert]:
        if not visited[neighbour]:
            component += find_components(snake_case_    ,snake_case_    ,snake_case_						)

    return component







def 		__lowercase					(       snake_case_  :  dict[int, list[int]]						)       ->list[list[int]]:



    '''simple docstring'''







    __A   :						List[str]									=					len(snake_case_						) * [False]
    __A   :						dict[int, list[int]]									=					{vert: [] for vert in range(len(snake_case_						)						)}

    for vert, neighbours in graph.items():
        for neighbour in neighbours:
            reversed_graph[neighbour].append(snake_case_						)

    __A   :						Any									=					[]
    for i, was_visited in enumerate(snake_case_						):
        if not was_visited:
            order += topology_sort(snake_case_    ,snake_case_    ,snake_case_						)

    __A   :						List[str]									=					[]
    __A   :						Optional[Any]									=					len(snake_case_						) * [False]

    for i in range(len(snake_case_						)						):
        __A   :						int									=					order[len(snake_case_						) - i - 1]
        if not visited[vert]:
            __A   :						Optional[Any]									=					find_components(snake_case_    ,snake_case_    ,snake_case_						)
            components_list.append(snake_case_						)

    return components_list











"""simple docstring"""



def 		__lowercase					(       snake_case_  :  int						)       ->Optional[Any]:



    '''simple docstring'''







    stooge(snake_case_    ,0    ,len(snake_case_						) - 1						)
    return arr







def 		__lowercase					(       snake_case_  :  Optional[Any]    ,snake_case_  :  Union[str, Any]    ,snake_case_  :  Any						)       ->Tuple:



    '''simple docstring'''







    if i >= h:
        return

    # If first element is smaller than the last then swap them
    if arr[i] > arr[h]:
        __A			,	__A   :						Optional[int]									=					arr[h], arr[i]

    # If there are more than 2 elements in the array
    if h - i + 1 > 2:
        __A   :						Any									=					(int)((h - i + 1) / 3						)

        # Recursively sort first 2/3 elements
        stooge(snake_case_    ,snake_case_    ,(h - t)						)

        # Recursively sort last 2/3 elements
        stooge(snake_case_    ,i + t    ,(snake_case_)						)

        # Recursively sort first 2/3 elements
        stooge(snake_case_    ,snake_case_    ,(h - t)						)


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




