





'''simple docstring'''

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__	:					List[str]	     =       'none'
lowerCAmelCase__	:					int	     =       'none'


def 		__UpperCamelCase		(       _UpperCAmelCase,    _UpperCAmelCase   ):
		__UpperCAmelCase     :				Optional[Any]					   =			value.split(_UpperCAmelCase   )
		return len(_UpperCAmelCase   ) > 1 and any((len(_UpperCAmelCase   ) == 3 for x in split)   )


def 		__UpperCamelCase		(       _UpperCAmelCase   ):


		if isinstance(_UpperCAmelCase,    _UpperCAmelCase   ):
				return value
		if isinstance(_UpperCAmelCase,    _UpperCAmelCase   ):
				return float(_UpperCAmelCase   )
		if not isinstance(_UpperCAmelCase,    _UpperCAmelCase   ):
				raise ValueError("Argument value is not a string. Can\'t parse it as float"   )
		__UpperCAmelCase     :				int					   =			value

		try:
				# Example: 1,000.7
				if "." in sanitized and "," in sanitized:
						return float(sanitized.replace(",",    ""   )   )
				# 1,000
				if "," in sanitized and _split_thousands(",",    _UpperCAmelCase   ):
						return float(sanitized.replace(",",    ""   )   )
				# 5,5556
				if "," in sanitized and sanitized.count(","   ) == 1 and not _split_thousands(",",    _UpperCAmelCase   ):
						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(_UpperCAmelCase   )
		except ValueError:
				# Avoid adding the sanitized value in the error message.
				raise ValueError("Unable to convert value to float"   )


def 		__UpperCamelCase		(       _UpperCAmelCase   ):


		if answer is None:
				return None
		try:
				__UpperCAmelCase     :				Optional[Any]					   =			convert_to_float(_UpperCAmelCase   )
				if isinstance(_UpperCAmelCase,    _UpperCAmelCase   ) and math.isnan(_UpperCAmelCase   ):
						return None
				return value
		except ValueError:
				return answer.lower()


lowerCAmelCase__	:					Tuple	     =       {
    'text': lambda x: x,
    'real': convert_to_float,
}


class 			SCREAMING_SNAKE_CASE__	(					enum.Enum						):







					"""simple docstring"""






					SCREAMING_SNAKE_CASE				=     0
					SCREAMING_SNAKE_CASE				=     1
					SCREAMING_SNAKE_CASE				=     2
					SCREAMING_SNAKE_CASE				=     3
					SCREAMING_SNAKE_CASE				=     4
					SCREAMING_SNAKE_CASE				=     5






class 			SCREAMING_SNAKE_CASE__	(					enum.Enum						):







					"""simple docstring"""






					SCREAMING_SNAKE_CASE				=     0
					SCREAMING_SNAKE_CASE				=     1
					SCREAMING_SNAKE_CASE				=     2






@dataclasses.dataclass
class 			SCREAMING_SNAKE_CASE__	:







					"""simple docstring"""






					SCREAMING_SNAKE_CASE				=     42
					SCREAMING_SNAKE_CASE				=     42
					SCREAMING_SNAKE_CASE				=     42






lowerCAmelCase__	:					List[Any]	     =       re.compile(R"\w+|[^\w\s]+", re.UNICODE | re.MULTILINE | re.DOTALL)


def 		__UpperCamelCase		(       _UpperCAmelCase   ):
		return list(_TOKENIZER.findall(x.lower()   )   )


def 		__UpperCamelCase		(       _UpperCAmelCase,    _UpperCAmelCase,    _UpperCAmelCase   ):


		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 		__UpperCamelCase		(       _UpperCAmelCase,    _UpperCAmelCase,    _UpperCAmelCase   ):
		__UpperCAmelCase     :				int					   =			table["types"]
		return _TYPE_CONVERTER[types[column]](_UpperCAmelCase   )


def 		__UpperCamelCase		(       _UpperCAmelCase   ):
		return isinstance(_UpperCAmelCase,    _UpperCAmelCase   )


def 		__UpperCamelCase		(       _UpperCAmelCase,    _UpperCAmelCase,    _UpperCAmelCase   ):


		for cond in conditions:
				__UpperCAmelCase     :				Optional[int]					   =			row[cond.column]

				__UpperCAmelCase     :				List[Any]					   =			_parse_value(_UpperCAmelCase,    cond.column,    cond.cmp_value   )

				if _is_string(_UpperCAmelCase   ) and _is_string(_UpperCAmelCase   ):
						__UpperCAmelCase     :				int					   =			_normalize_for_match(_UpperCAmelCase   )
						__UpperCAmelCase     :				int					   =			_normalize_for_match(_UpperCAmelCase   )

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

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


def 		__UpperCamelCase		(       _UpperCAmelCase,    _UpperCAmelCase,    _UpperCAmelCase   ):


		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(_UpperCAmelCase   )   )

		# If we have just one answer, if float returns it or try a conversion.
		__UpperCAmelCase     :				Any					   =			[table["rows"][i][j] for (i, j) in answer_coordinates]
		if len(_UpperCAmelCase   ) == 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(_UpperCAmelCase,    (int, float)   ) for v in values)   ):
				return None

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


def 		__UpperCamelCase		(       _UpperCAmelCase,    _UpperCAmelCase   ):
		__UpperCAmelCase     :				Optional[Any]					   =			sql_query["agg"]
		if aggregation_op_index >= 3:
				__UpperCAmelCase     :				str					   =			_Aggregation(_UpperCAmelCase   )
		else:
				__UpperCAmelCase     :				Union[str, Any]					   =			_Aggregation.NONE

		__UpperCAmelCase     :				List[str]					   =			sql_query["sel"]
		__UpperCAmelCase     :				Any					   =			[
		    _Condition(_UpperCAmelCase,    _Operator(_UpperCAmelCase   ),    _UpperCAmelCase   )
		    for column, operator, cmp_value in zip(
		        sql_query["conds"]["column_index"],    sql_query["conds"]["operator_index"],    sql_query["conds"]["condition"]   )
		]

		__UpperCAmelCase     :				List[Any]					   =			[]
		for row in range(len(table["rows"]   )   ):
				if _respect_conditions(_UpperCAmelCase,    table["rows"][row],    _UpperCAmelCase   ):
						indices.append((row, target_column)   )

		if not indices:
				return [], aggregation_op

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

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

				__UpperCAmelCase     :				Optional[Any]					   =			[indices[reduced[1]]]
				return ret, _Aggregation.NONE

		return indices, aggregation_op


def 		__UpperCamelCase		(       _UpperCAmelCase,    _UpperCAmelCase,    _UpperCAmelCase   ):


		if float_answer is not None:
				return [str(_UpperCAmelCase   )]
		return [str(table["real_rows"][r][c]   ) for r, c in answer_coordinates]






def 		__UpperCamelCase		(       _UpperCAmelCase,    _UpperCAmelCase   ):
		__UpperCAmelCase   ,       __UpperCAmelCase     :				List[Any]					   =			_get_answer_coordinates(_UpperCAmelCase,    _UpperCAmelCase   )
		__UpperCAmelCase     :				Union[str, Any]					   =			_get_float_answer(_UpperCAmelCase,    _UpperCAmelCase,    _UpperCAmelCase   )
		__UpperCAmelCase     :				Union[str, Any]					   =			_get_answer_text(_UpperCAmelCase,    _UpperCAmelCase,    _UpperCAmelCase   )
		# keep the original data the same with TaPas
		if len(_UpperCAmelCase   ) == 0:
				__UpperCAmelCase     :				Tuple					   =			[EMPTY_ANSWER]
		return answer_text










'''simple docstring'''


def 		snake_case_    (UpperCamelCase       :  List[str] ,						UpperCamelCase       :  List[Any] ,						UpperCamelCase       :  Union[str, Any]      ):





							'''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(UpperCamelCase ,						UpperCamelCase ,						UpperCamelCase      )
def 		snake_case_    (UpperCamelCase       :  Union[str, Any]      ):





							'''simple docstring'''


							_a	     =				len(UpperCamelCase      )
							for i in range(n // 2 - 1 ,						-1 ,						-1      ):
														heapify(UpperCamelCase ,						UpperCamelCase ,						UpperCamelCase      )
							for i in range(n - 1 ,						0 ,						-1      ):
														_a     ,							_a	     =				unsorted[i], unsorted[0]
														heapify(UpperCamelCase ,						0 ,						UpperCamelCase      )
							return unsorted


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

