
import math



def 							lowerCamelCase_	( __UpperCamelCase			,    __UpperCamelCase = 0			,    __UpperCamelCase = 0  ):
				A_													=	end or len(a__  )
				for i in range(a__			,    a__  ):
								A_													=	i
								A_													=	array[i]
								while temp_index != start and temp_index_value < array[temp_index - 1]:
												A_													=	array[temp_index - 1]
												temp_index -= 1
								A_													=	temp_index_value
				return array



def 							lowerCamelCase_	( __UpperCamelCase			,    __UpperCamelCase			,    __UpperCamelCase  ):  # Max Heap
				A_													=	index
				A_													=	2 * index + 1  # Left Node
				A_													=	2 * index + 2  # Right Node

				if left_index < heap_size and array[largest] < array[left_index]:
								A_													=	left_index

				if right_index < heap_size and array[largest] < array[right_index]:
								A_													=	right_index

				if largest != index:
								A_													=	array[largest], array[index]
								heapify(a__			,    a__			,    a__  )



def 							lowerCamelCase_	( __UpperCamelCase  ):
				A_													=	len(a__  )

				for i in range(n // 2			,    -1			,    -1  ):
								heapify(a__			,    a__			,    a__  )

				for i in range(n - 1			,    0			,    -1  ):
								A_													=	array[0], array[i]
								heapify(a__			,    0			,    a__  )

				return array



def 							lowerCamelCase_	( __UpperCamelCase			,    __UpperCamelCase			,    __UpperCamelCase			,    __UpperCamelCase  ):






				if (array[first_index] > array[middle_index]) != (
				    array[first_index] > array[last_index]
				):
								return array[first_index]
				elif (array[middle_index] > array[first_index]) != (
				    array[middle_index] > array[last_index]
				):
								return array[middle_index]
				else:
								return array[last_index]



def 							lowerCamelCase_	( __UpperCamelCase			,    __UpperCamelCase			,    __UpperCamelCase			,    __UpperCamelCase  ):
				A_													=	low
				A_													=	high
				while True:
								while array[i] < pivot:
												i += 1
								j -= 1
								while pivot < array[j]:
												j -= 1
								if i >= j:
												return i
								A_													=	array[j], array[i]
								i += 1



def 							lowerCamelCase_	( __UpperCamelCase  ):






				if len(a__  ) == 0:
								return array
				A_													=	2 * math.ceil(math.loga(len(a__  )  )  )
				A_													=	16
				return intro_sort(a__			,    0			,    len(a__  )			,    a__			,    a__  )



def 							lowerCamelCase_	( __UpperCamelCase			,    __UpperCamelCase			,    __UpperCamelCase			,    __UpperCamelCase			,    __UpperCamelCase  ):






				while end - start > size_threshold:
								if max_depth == 0:
												return heap_sort(a__  )
								max_depth -= 1
								A_													=	median_of_a(a__			,    a__			,    start + ((end - start) // 2) + 1			,    end - 1  )
								A_													=	partition(a__			,    a__			,    a__			,    a__  )
								intro_sort(a__			,    a__			,    a__			,    a__			,    a__  )
								A_													=	p
				return insertion_sort(a__			,    a__			,    a__  )


if __name__ == "__main__":
						import doctest

						doctest.testmod()

						SCREAMING_SNAKE_CASE :		Optional[Any]       			=							input("Enter numbers separated by a comma : ").strip()
						SCREAMING_SNAKE_CASE :		str       			=							[float(item) for item in user_input.split(",")]
						print(sort(unsorted))







"""simple docstring"""


from __future__ import annotations

from collections import namedtuple
from dataclasses import dataclass




@dataclass
class 						__UpperCamelCase     :
					lowercase_    :				int
					lowercase_    :				TreeNode | None      =  None
					lowercase_    :				TreeNode | None      =  None


__SCREAMING_SNAKE_CASE   =   namedtuple('CoinsDistribResult', 'moves excess')


def        UpperCAmelCase      (					a__ ):





						'''simple docstring'''






						if root is None:
												return 0

						# Validation
						def count_nodes(a__ ) -> int:
												if node is None:
																		return 0

												return count_nodes(node.left ) + count_nodes(node.right ) + 1

						def count_coins(a__ ) -> int:
												if node is None:
																		return 0

												return count_coins(node.left ) + count_coins(node.right ) + node.data

						if count_nodes(a__ ) != count_coins(a__ ):
												raise ValueError('The nodes number should be same as the number of coins' )

						# Main calculation
						def get_distrib(a__ ) -> CoinsDistribResult:

												if node is None:
																		return CoinsDistribResult(0     ,      1 )

												lowerCAmelCase	, lowerCAmelCase   :Optional[int]						=			get_distrib(node.left )
												lowerCAmelCase	, lowerCAmelCase   :str						=			get_distrib(node.right )

												lowerCAmelCase   :str						=			1 - left_distrib_excess
												lowerCAmelCase   :Optional[Any]						=			1 - right_distrib_excess

												lowerCAmelCase   :Any						=			(
												    left_distrib_moves
												    + right_distrib_moves
												    + abs(a__ )
												    + abs(a__ )
												)
												lowerCAmelCase   :Tuple						=			node.data - coins_to_left - coins_to_right

												return CoinsDistribResult(a__     ,      a__ )

						return get_distrib(a__ )[0]


if __name__ == "__main__":
		import doctest

		doctest.testmod()