



'''simple docstring'''







def  SCREAMING_SNAKE_CASE__ (				SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     ):
		SCREAMING_SNAKE_CASE_						:str										=      index
		SCREAMING_SNAKE_CASE_						:Tuple										=      2 * index + 1
		SCREAMING_SNAKE_CASE_						:List[Any]										=      2 * index + 2
		if left_index < heap_size and unsorted[left_index] > unsorted[largest]:
				SCREAMING_SNAKE_CASE_						:List[Any]										=      left_index

		if right_index < heap_size and unsorted[right_index] > unsorted[largest]:
				SCREAMING_SNAKE_CASE_						:List[Any]										=      right_index

		if largest != index:
				SCREAMING_SNAKE_CASE_						,		SCREAMING_SNAKE_CASE_						:Any										=      unsorted[index], unsorted[largest]
				heapify(SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     )







def  SCREAMING_SNAKE_CASE__ (				SCREAMING_SNAKE_CASE     ):
		SCREAMING_SNAKE_CASE_						:Optional[int]										=      len(SCREAMING_SNAKE_CASE     )
		for i in range(n // 2 - 1 ,		-1 ,		-1     ):
				heapify(SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     )
		for i in range(n - 1 ,		0 ,		-1     ):
				SCREAMING_SNAKE_CASE_						,		SCREAMING_SNAKE_CASE_						:int										=      unsorted[i], unsorted[0]
				heapify(SCREAMING_SNAKE_CASE ,		0 ,		SCREAMING_SNAKE_CASE     )
		return unsorted


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






def 		lowercase__ (		__A:						int					):





					'''simple docstring'''






					if not isinstance(__A				,__A					):
										__magic_name__				:						Dict     				=				F'''Input value of [number={number}] must be an integer'''
										raise TypeError(__A					)
					if number < 0 or number % 2 == 1:
										return False
					__magic_name__				:						Any     				=				int(number**0.5					)
					return number == number_sqrt * (number_sqrt + 1)


if __name__ == "__main__":
	import doctest

	doctest.testmod()



