




"""simple docstring"""


from graphs.minimum_spanning_tree_kruskal import kruskal


def 					UpperCAmelCase__       ():
  """simple docstring"""

  _snake_case							:		Union[str, Any]								=  9
  _snake_case							:		Dict								=  [
      [0, 1, 4],
      [0, 7, 8],
      [1, 2, 8],
      [7, 8, 7],
      [7, 6, 1],
      [2, 8, 2],
      [8, 6, 6],
      [2, 3, 7],
      [2, 5, 4],
      [6, 5, 2],
      [3, 5, 14],
      [3, 4, 9],
      [5, 4, 10],
      [1, 7, 11],
  ]

  _snake_case							:		Optional[int]								=  kruskal(snake_case__		,   snake_case__    )

  _snake_case							:		List[Any]								=  [
      [7, 6, 1],
      [2, 8, 2],
      [6, 5, 2],
      [0, 1, 4],
      [2, 5, 4],
      [2, 3, 7],
      [0, 7, 8],
      [3, 4, 9],
  ]

  assert sorted(snake_case__    ) == sorted(snake_case__    )








"""simple docstring"""


def 					UpperCAmelCase__       (snake_case__							:					Union[str, Any]    ):
  """simple docstring"""

  stooge(snake_case__		,   0		,   len(snake_case__    ) - 1    )
  return arr


def 					UpperCAmelCase__       (snake_case__							:					List[Any]		,   snake_case__							:					Any		,   snake_case__							:					int    ):
  """simple docstring"""

  if i >= h:
    return

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

  # If there are more than 2 elements in the array
  if h - i + 1 > 2:
    _snake_case							:		Dict								=  (int)((h - i + 1) / 3    )

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

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

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


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


