
"""simple docstring"""







def    __lowerCAmelCase    (_UpperCamelCase		):
 stooge(_UpperCamelCase	,  0	,  len(_UpperCamelCase		) - 1		)
 return arr
def    __lowerCAmelCase    (_UpperCamelCase	,  _UpperCamelCase	,  _UpperCamelCase		):
 if i >= h:
  return

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

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

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

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

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


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

"""simple docstring"""







def    __lowerCAmelCase    (_UpperCamelCase		):
	if len(_UpperCamelCase		) <= 1:
		return lst

	__lowerCAmelCase      :						str						      =				1

	while i < len(_UpperCamelCase		):
		if lst[i - 1] <= lst[i]:
			i += 1
		else:
			__lowerCAmelCase      ,       __lowerCAmelCase      :						List[Any]						      =				lst[i], lst[i - 1]
			i -= 1
			if i == 0:
				__lowerCAmelCase      :						int						      =				1

	return lst


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