






"""simple docstring"""




def 						__UpperCAmelCase      (					a_							,					a_							,					a_):
							snake_case_           =							index
							snake_case_           =							2 * index + 1
							snake_case_           =							2 * index + 2
							if left_index < heap_size and unsorted[left_index] > unsorted[largest]:
														snake_case_           =							left_index

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

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





def 						__UpperCAmelCase      (					a_):
							snake_case_           =							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):
														snake_case_      ,		snake_case_           =							unsorted[i], unsorted[0]
														heapify(SCREAMING_SNAKE_CASE_							,					0							,					SCREAMING_SNAKE_CASE_)
							return unsorted


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













def 						__UpperCAmelCase      (					a_):
							return 1 if input_a == 0 else 0





def 						__UpperCAmelCase      (					):
							assert not_gate(0) == 1
							assert not_gate(1) == 0


if __name__ == "__main__":
	print(not_gate(0))
	print(not_gate(1))





