





import dataclasses
import enum
import functools
import math
import re

# The following script is adapted from the script of TaPas.
# Original: https://github.com/google-research/tapas/master/wikisql_utils.py
from typing import Any, List, Text


lowerCamelCase__						=  'none'
lowerCamelCase__						=  'none'

def 	A(__a:       List[Any]		,					__a:       str							):
		lowerCAmelCase_				=							value.split(lowercase__							)
		return len(lowercase__							) > 1 and any((len(lowercase__							) == 3 for x in split)							)

def 	A(__a:       int							):
		if isinstance(lowercase__		,					lowercase__							):
				return value
		if isinstance(lowercase__		,					lowercase__							):
				return float(lowercase__							)
		if not isinstance(lowercase__		,					lowercase__							):
				raise ValueError("Argument value is not a string. Can't parse it as float"							)
		lowerCAmelCase_				=							value

		try:
				# Example: 1,000.7
				if "." in sanitized and "," in sanitized:
						return float(sanitized.replace(","		,					""							)							)
				# 1,000
				if "," in sanitized and _split_thousands(","		,					lowercase__							):
						return float(sanitized.replace(","		,					""							)							)
				# 5,5556
				if "," in sanitized and sanitized.count(","							) == 1 and not _split_thousands(","		,					lowercase__							):
						return float(sanitized.replace(","		,					"."							)							)
				# 0.0.0.1
				if sanitized.count("."							) > 1:
						return float(sanitized.replace("."		,					""							)							)
				# 0,0,0,1
				if sanitized.count(","							) > 1:
						return float(sanitized.replace(","		,					""							)							)
				return float(lowercase__							)
		except ValueError:
				# Avoid adding the sanitized value in the error message.
				raise ValueError("Unable to convert value to float"							)

def 	A(__a:       Tuple							):
		if answer is None:
				return None
		try:
				lowerCAmelCase_				=							convert_to_float(lowercase__							)
				if isinstance(lowercase__		,					lowercase__							) and math.isnan(lowercase__							):
						return None
				return value
		except ValueError:
				return answer.lower()


lowerCamelCase__						=  {
    'text': lambda x: x,
    'real': convert_to_float,
}
class      __magic_name__       (enum.Enum      ):
					lowerCamelCase__					=			0
					lowerCamelCase__					=			1
					lowerCamelCase__					=			2
					lowerCamelCase__					=			3
					lowerCamelCase__					=			4
					lowerCamelCase__					=			5





class      __magic_name__       (enum.Enum      ):
					lowerCamelCase__					=			0
					lowerCamelCase__					=			1
					lowerCamelCase__					=			2





@dataclasses.dataclass
class      __magic_name__       :
					lowerCamelCase__					=			42
					lowerCamelCase__					=			42
					lowerCamelCase__					=			42





lowerCamelCase__						=  re.compile(R'''\w+|[^\w\s]+''', re.UNICODE | re.MULTILINE | re.DOTALL)

def 	A(__a:       Optional[int]							):
		return list(_TOKENIZER.findall(x.lower()							)							)

def 	A(__a:       Union[str, Any]		,					__a:       Optional[Any]		,					__a:       Tuple							):
		if operator == _Operator.EQUALS:
				return src == tgt
		elif operator == _Operator.GREATER:
				return src > tgt
		elif operator == _Operator.LESSER:
				return src < tgt
		raise ValueError(F"Unknown operator: {operator}"							)

def 	A(__a:       Tuple		,					__a:       int		,					__a:       Optional[int]							):
		lowerCAmelCase_				=							table["types"]
		return _TYPE_CONVERTER[types[column]](lowercase__							)

def 	A(__a:       Dict							):
		return isinstance(lowercase__		,					lowercase__							)

def 	A(__a:       List[Any]		,					__a:       int		,					__a:       int							):
		for cond in conditions:
				lowerCAmelCase_				=							row[cond.column]

				lowerCAmelCase_				=							_parse_value(lowercase__		,					cond.column		,					cond.cmp_value							)

				if _is_string(lowercase__							) and _is_string(lowercase__							):
						lowerCAmelCase_				=							_normalize_for_match(lowercase__							)
						lowerCAmelCase_				=							_normalize_for_match(lowercase__							)

				if not isinstance(lowercase__		,					type(lowercase__							)							):
						raise ValueError("Type difference {} != {}".format(type(lowercase__							)		,					type(lowercase__							)							)							)

				if not _compare(cond.operator		,					lowercase__		,					lowercase__							):
						return False
		return True

def 	A(__a:       str		,					__a:       Dict		,					__a:       str							):
		if not answer_coordinates:
				if aggregation_op == _Aggregation.COUNT:
						return 0.0
				else:
						return EMPTY_ANSWER_AGG

    # Count can support non numeric answers.
		if aggregation_op == _Aggregation.COUNT:
				return float(len(lowercase__							)							)

		# If we have just one answer, if float returns it or try a conversion.
		lowerCAmelCase_				=							[table["rows"][i][j] for (i, j) in answer_coordinates]
		if len(lowercase__							) == 1:
				try:
						return convert_to_float(values[0]							)
				except ValueError as e:
						if aggregation_op != _Aggregation.NONE:
								raise e

		if aggregation_op == _Aggregation.NONE:
				return None

		# Other aggregation only support numeric values. Bail out if we have strings.
		if not all((isinstance(lowercase__		,					(int, float)							) for v in values)							):
				return None

		if aggregation_op == _Aggregation.SUM:
				return float(sum(lowercase__							)							)
		elif aggregation_op == _Aggregation.AVERAGE:
				return sum(lowercase__							) / len(lowercase__							)
		else:
				raise ValueError(F"Unknown aggregation: {aggregation_op}"							)

def 	A(__a:       List[str]		,					__a:       Dict							):
		lowerCAmelCase_				=							sql_query["agg"]
		if aggregation_op_index >= 3:
				lowerCAmelCase_				=							_Aggregation(lowercase__							)
		else:
				lowerCAmelCase_				=							_Aggregation.NONE

		lowerCAmelCase_				=							sql_query["sel"]
		lowerCAmelCase_				=							[
		    _Condition(lowercase__		,					_Operator(lowercase__							)		,					lowercase__							)
		    for column, operator, cmp_value in zip(
		        sql_query["conds"]["column_index"]		,					sql_query["conds"]["operator_index"]		,					sql_query["conds"]["condition"]							)
		]

		lowerCAmelCase_				=							[]
		for row in range(len(table["rows"]							)							):
				if _respect_conditions(lowercase__		,					table["rows"][row]		,					lowercase__							):
						indices.append((row, target_column)							)

		if not indices:
				return [], aggregation_op

		if len(lowercase__							) == 1:
				return indices, aggregation_op

		# Parsing of MIN/MAX.
		if aggregation_op_index in (1, 2):
				lowerCAmelCase_				=							{2: min, 1: max}
				lowerCAmelCase_				=							[(table["rows"][i][j], index) for index, (i, j) in enumerate(lowercase__							)]
				lowerCAmelCase_				=							functools.reduce(operators[sql_query["agg"]]		,					lowercase__							)

				lowerCAmelCase_				=							[indices[reduced[1]]]
				return ret, _Aggregation.NONE

		return indices, aggregation_op

def 	A(__a:       Optional[int]		,					__a:       List[str]		,					__a:       Any							):
		if float_answer is not None:
				return [str(lowercase__							)]
		return [str(table["real_rows"][r][c]							) for r, c in answer_coordinates]


def 	A(__a:       int		,					__a:       Optional[Any]							):
		lowerCAmelCase_		,   lowerCAmelCase_				=							_get_answer_coordinates(lowercase__		,					lowercase__							)
		lowerCAmelCase_				=							_get_float_answer(lowercase__		,					lowercase__		,					lowercase__							)
		lowerCAmelCase_				=							_get_answer_text(lowercase__		,					lowercase__		,					lowercase__							)
		# keep the original data the same with TaPas
		if len(lowercase__							) == 0:
				lowerCAmelCase_				=							[EMPTY_ANSWER]
		return answer_text




"""simple docstring"""




def    __SCREAMING_SNAKE_CASE						(						lowercase__			,							lowercase__			,							lowercase__      ):
					"""simple docstring"""
					A			=					index
					A			=					2 * index + 1
					A			=					2 * index + 2
					if left_index < heap_size and unsorted[left_index] > unsorted[largest]:
										A			=					left_index

					if right_index < heap_size and unsorted[right_index] > unsorted[largest]:
										A			=					right_index

					if largest != index:
										A			,    A			=					unsorted[index], unsorted[largest]
										heapify(lowercase__			,							lowercase__			,							lowercase__      )
def    __SCREAMING_SNAKE_CASE						(						lowercase__      ):
					"""simple docstring"""
					A			=					len(lowercase__      )
					for i in range(n // 2 - 1			,							-1			,							-1      ):
										heapify(lowercase__			,							lowercase__			,							lowercase__      )
					for i in range(n - 1			,							0			,							-1      ):
										A			,    A			=					unsorted[i], unsorted[0]
										heapify(lowercase__			,							0			,							lowercase__      )
					return unsorted


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





