





UpperCAmelCase	:	str		     =       0  # The first color of the flag.
UpperCAmelCase	:	Any		     =       1  # The second color of the flag.
UpperCAmelCase	:	int		     =       2  # The third color of the flag.
UpperCAmelCase	:	List[Any]		     =       (red, white, blue)
def      _A       (		SCREAMING_SNAKE_CASE     :   list						):





  """simple docstring"""



  if not sequence:
    return []
  if len(SCREAMING_SNAKE_CASE						) == 1:
    return list(SCREAMING_SNAKE_CASE						)
  a__	:					Tuple										=0
  a__	:					Tuple										=len(SCREAMING_SNAKE_CASE						) - 1
  a__	:					Optional[int]										=0
  while mid <= high:
    if sequence[mid] == colors[0]:
      a__					,							a__	:					Tuple										=sequence[mid], sequence[low]
      low += 1
      mid += 1
    elif sequence[mid] == colors[1]:
      mid += 1
    elif sequence[mid] == colors[2]:
      a__					,							a__	:					Dict										=sequence[high], sequence[mid]
      high -= 1
    else:
      a__	:					Tuple										=f'''The elements inside the sequence must contains only {colors} values'''
      raise ValueError(SCREAMING_SNAKE_CASE						)
  return sequence


if __name__ == "__main__":
     import doctest

     doctest.testmod()

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













from __future__ import annotations
def      _A       (		SCREAMING_SNAKE_CASE     :   list						):





  """simple docstring"""



  if len(SCREAMING_SNAKE_CASE						) == 0:
    return []
  a__					,							a__	:					int										=min(SCREAMING_SNAKE_CASE						), max(SCREAMING_SNAKE_CASE						)
  a__	:					Optional[int]										=int(max_value - min_value						) + 1
  a__	:					list[list]										=[[] for _ in range(SCREAMING_SNAKE_CASE						)]

  for i in my_list:
    buckets[int(i - min_value						)].append(SCREAMING_SNAKE_CASE						)

  return [v for bucket in buckets for v in sorted(SCREAMING_SNAKE_CASE						)]


if __name__ == "__main__":
     from doctest import testmod

     testmod()
     assert bucket_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
     assert bucket_sort([0, 1, -10, 15, 2, -2]) == [-10, -2, 0, 1, 2, 15]






