


def 							lowerCAmelCase_	(   __lowerCamelCase      ):
							stooge(__lowerCamelCase				,      0				,      len(__lowerCamelCase      ) - 1      )
							return arr







def 							lowerCAmelCase_	(   __lowerCamelCase				,      __lowerCamelCase				,      __lowerCamelCase      ):
							if i >= h:
														return

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

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

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

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

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


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







'''simple docstring'''






import functools






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		)    ->   int:
      snake_case__       :   Any	      =    len(__SCREAMING_SNAKE_CASE		)
      snake_case__       :   List[str]	      =    len(__SCREAMING_SNAKE_CASE		)

      @functools.cache
      def min_distance(__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		) -> int:
            # if first word index is overflow - delete all from the second word
            if indexa >= len_worda:
                  return len_worda - indexa
            # if second word index is overflow - delete all from the first word
            if indexa >= len_worda:
                  return len_worda - indexa
            snake_case__       :   Union[str, Any]	      =    int(worda[indexa] != worda[indexa]		)  # current letters not identical
            return min(
                1 + min_distance(indexa + 1				,      __SCREAMING_SNAKE_CASE		)				,      1 + min_distance(__SCREAMING_SNAKE_CASE				,      indexa + 1		)				,      diff + min_distance(indexa + 1				,      indexa + 1		)				,      )

      return min_distance(0				,      0		)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
