





def 		A_				(     _lowerCAmelCase     )						-> Dict:
 stooge(_lowerCAmelCase							,   0							,   len(_lowerCAmelCase     ) - 1     )
 return arr



def 		A_				(     _lowerCAmelCase							,   _lowerCAmelCase							,   _lowerCAmelCase     )						-> Union[str, Any]:
 if i >= h:
  return

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

 # If there are more than 2 elements in the array
 if h - i + 1 > 2:
  UpperCamelCase	:					int       	=   (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__":
    __lowerCamelCase       :     Any   =     input("""Enter numbers separated by a comma:\n""").strip()
    __lowerCamelCase       :     Optional[Any]   =     [int(item) for item in user_input.split(""",""")]
    print(stooge_sort(unsorted))







import functools



def 		A_				(     _lowerCAmelCase							,   _lowerCAmelCase     )						-> int:
 UpperCamelCase	:					Optional[int]       	=   len(_lowerCAmelCase     )
 UpperCamelCase	:					List[str]       	=   len(_lowerCAmelCase     )

 @functools.cache
 def min_distance(_lowerCAmelCase							,   _lowerCAmelCase     ) -> 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
  UpperCamelCase	:					Union[str, Any]       	=   int(worda[indexa] != worda[indexa]     )  # current letters not identical
  return min(
      1 + min_distance(indexa + 1							,   _lowerCAmelCase     )							,   1 + min_distance(_lowerCAmelCase							,   indexa + 1     )							,   diff + min_distance(indexa + 1							,   indexa + 1     )							,   )

 return min_distance(0							,   0     )


if __name__ == "__main__":
    import doctest

    doctest.testmod()
