def 						A__  (					__A	):







    '''simple docstring'''

    def merge(__A   , __A	) -> list:

        def _merge():
            while left and right:
                yield (left if left[0] <= right[0] else right).pop(0	)
            yield from left
            yield from right

        return list(_merge()	)

    if len(__A	) <= 1:
        return collection
    _lowerCamelCase     :		Dict 						=						len(__A	) // 2
    return merge(merge_sort(collection[:mid]	)   , merge_sort(collection[mid:]	)	)


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    lowerCAmelCase			:							Tuple     =			input("Enter numbers separated by a comma:\n").strip()
    lowerCAmelCase			:							Dict     =			[int(item) for item in user_input.split(",")]
    print(*merge_sort(unsorted), sep=",")





lowerCAmelCase			:							Tuple     =0  # The first color of the flag.
lowerCAmelCase			:							Union[str, Any]     =1  # The second color of the flag.
lowerCAmelCase			:							Any     =2  # The third color of the flag.
lowerCAmelCase			:							List[str]     =(red, white, blue)







def 						A__  (					__A	):







    '''simple docstring'''
    if not sequence:
        return []
    if len(__A	) == 1:
        return list(__A	)
    _lowerCamelCase     :		int 						=						0
    _lowerCamelCase     :		Dict 						=						len(__A	) - 1
    _lowerCamelCase     :		str 						=						0
    while mid <= high:
        if sequence[mid] == colors[0]:
            _lowerCamelCase						,							_lowerCamelCase     :		Tuple 						=						sequence[mid], sequence[low]
            low += 1
            mid += 1
        elif sequence[mid] == colors[1]:
            mid += 1
        elif sequence[mid] == colors[2]:
            _lowerCamelCase						,							_lowerCamelCase     :		str 						=						sequence[high], sequence[mid]
            high -= 1
        else:
            _lowerCamelCase     :		int 						=						F"""The elements inside the sequence must contains only {colors} values"""
            raise ValueError(__A	)
    return sequence


if __name__ == "__main__":
    import doctest

    doctest.testmod()

    lowerCAmelCase			:							List[str]     =input("Enter numbers separated by commas:\n").strip()
    lowerCAmelCase			:							Dict     =[int(item.strip()) for item in user_input.split(",")]
    print(F"""{dutch_national_flag_sort(unsorted)}""")




