




'''simple docstring'''





def       __a      (  _UpperCamelCase:       List[str]       )		->					bool:

     """simple docstring"""




     _snake_case				= set()
     # To detect a back edge, keep track of vertices currently in the recursion stack
     _snake_case				= set()
     return any(
         node not in visited and depth_first_search(__lowerCAmelCase   ,		__lowerCAmelCase   ,		__lowerCAmelCase   ,		__lowerCAmelCase       )
         for node in graph       )





def       __a      (  _UpperCamelCase:       Union[str, Any]   ,		_UpperCamelCase:       Any   ,		_UpperCamelCase:       Tuple   ,		_UpperCamelCase:       Union[str, Any]       )		->					bool:

     """simple docstring"""




     visited.add(__lowerCAmelCase       )
     rec_stk.add(__lowerCAmelCase       )

     for node in graph[vertex]:
          if node not in visited:
               if depth_first_search(__lowerCAmelCase   ,		__lowerCAmelCase   ,		__lowerCAmelCase   ,		__lowerCAmelCase       ):
                    return True
          elif node in rec_stk:
               return True

    # The node needs to be removed from recursion stack before function ends
     rec_stk.remove(__lowerCAmelCase       )
     return False


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

   testmod()







def        __a			(   __lowerCAmelCase   )     ->     List[str]:
					stooge(__lowerCAmelCase      ,	0      ,	len(__lowerCAmelCase   ) - 1   )
					return arr

def        __a			(   __lowerCAmelCase      ,	__lowerCAmelCase      ,	__lowerCAmelCase   )     ->     int:
					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							:     Any						=				arr[h], arr[i]

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