
def   __SCREAMING_SNAKE_CASE (		SCREAMING_SNAKE_CASE )		-> Union[str, Any]:
		stooge(SCREAMING_SNAKE_CASE ,    0 ,    len(SCREAMING_SNAKE_CASE ) - 1 )
		return arr



def   __SCREAMING_SNAKE_CASE (		SCREAMING_SNAKE_CASE ,    SCREAMING_SNAKE_CASE ,    SCREAMING_SNAKE_CASE )		-> Optional[Any]:
		if i >= h:
				return

		# If first element is smaller than the last then swap them
		if arr[i] > arr[h]:
				SCREAMING_SNAKE_CASE_  ,      SCREAMING_SNAKE_CASE_					:	List[Any]		  =			arr[h], arr[i]

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

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

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

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


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








'''simple docstring'''
import colorsys

from PIL import Image  # type: ignore







def 		A_(     A						:		float		,     A						:		float		,     A						:		int):
							UpperCamelCase   			=     x
							UpperCamelCase   			=     y
							for step in range(A):  # noqa: B007
														UpperCamelCase   			=     a * a - b * b + x
														UpperCamelCase   			=     2 * a * b + y
														UpperCamelCase   			=     a_new

														# divergence happens for all complex number with an absolute value
														# greater than 4
														if a * a + b * b > 4:
																					break
							return step / (max_step - 1)







def 		A_(     A						:		float):
							if distance == 1:
														return (0, 0, 0)
							else:
														return (255, 255, 255)







def 		A_(     A						:		float):
							if distance == 1:
														return (0, 0, 0)
							else:
														return tuple(round(i * 255) for i in colorsys.hsv_to_rgb(A		,     1		,     1))







def 		A_(     A						:		int = 800		,     A						:		int = 600		,     A						:		float = -0.6		,     A						:		float = 0		,     A						:		float = 3.2		,     A						:		int = 50		,     A						:		bool = True		,     ):
							UpperCamelCase   			=     Image.new('RGB'		,     (image_width, image_height))
							UpperCamelCase   			=     img.load()

							# loop through the image-coordinates
							for image_x in range(A):
														for image_y in range(A):
																					# determine the figure-coordinates based on the image-coordinates
																					UpperCamelCase   			=     figure_width / image_width * image_height
																					UpperCamelCase   			=     figure_center_x + (image_x / image_width - 0.5) * figure_width
																					UpperCamelCase   			=     figure_center_y + (image_y / image_height - 0.5) * figure_height

																					UpperCamelCase   			=     get_distance(A		,     A		,     A)

																					# color the corresponding pixel based on the selected coloring-function
																					if use_distance_color_coding:
																												UpperCamelCase   			=     get_color_coded_rgb(A)
																					else:
																												UpperCamelCase   			=     get_black_and_white_rgb(A)

							return img


if __name__ == "__main__":
						import doctest

						doctest.testmod()

						# colored version, full figure
						lowerCAmelCase					:    Any           = get_image()

						# uncomment for colored version, different section, zoomed in
						# img = get_image(figure_center_x = -0.6, figure_center_y = -0.4,
						# figure_width = 0.8)

						# uncomment for black and white version, full figure
						# img = get_image(use_distance_color_coding = False)

						# uncomment to save the image
						# img.save("mandelbrot.png")

						img.show()




