
'''simple docstring'''

def 					A       ( UpperCamelCase_   :       int  ,		UpperCamelCase_   :       List[str]  ,		UpperCamelCase_   :       Optional[int] )   ->    List[Any]:







			'''simple docstring'''



			lowerCAmelCase__									=							index
			lowerCAmelCase__									=							2 * index + 1
			lowerCAmelCase__									=							2 * index + 2
			if left_index < heap_size and unsorted[left_index] > unsorted[largest]:
						lowerCAmelCase__									=							left_index

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

			if largest != index:
						lowerCAmelCase__		,lowerCAmelCase__									=							unsorted[index], unsorted[largest]
						heapify(UpperCamelCase_  ,		UpperCamelCase_  ,		UpperCamelCase_ )







def 					A       ( UpperCamelCase_   :       int )   ->    Any:







			'''simple docstring'''



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


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







'''simple docstring'''

import math







def 					A       ( UpperCamelCase_   :       int )   ->    list:







			'''simple docstring'''



			if n <= 0:
						raise ValueError("Only positive integers have prime factors" )
			lowerCAmelCase__									=							[]
			while n % 2 == 0:
						pf.append(2 )
						lowerCAmelCase__									=							int(n / 2 )
			for i in range(3  ,		int(math.sqrt(UpperCamelCase_ ) ) + 1  ,		2 ):
						while n % i == 0:
									pf.append(UpperCamelCase_ )
									lowerCAmelCase__									=							int(n / i )
			if n > 2:
						pf.append(UpperCamelCase_ )
			return pf







def 					A       ( UpperCamelCase_   :       int )   ->    int:







			'''simple docstring'''



			if n <= 0:
						raise ValueError("Only positive numbers are accepted" )
			lowerCAmelCase__									=							1
			lowerCAmelCase__									=							1
			while n % 2 == 0:
						temp += 1
						lowerCAmelCase__									=							int(n / 2 )
			div *= temp
			for i in range(3  ,		int(math.sqrt(UpperCamelCase_ ) ) + 1  ,		2 ):
						lowerCAmelCase__									=							1
						while n % i == 0:
									temp += 1
									lowerCAmelCase__									=							int(n / i )
						div *= temp
			if n > 1:
						div *= 2
			return div







def 					A       ( UpperCamelCase_   :       int )   ->    int:







			'''simple docstring'''



			if n <= 0:
						raise ValueError("Only positive numbers are accepted" )
			lowerCAmelCase__									=							1
			lowerCAmelCase__									=							1
			while n % 2 == 0:
						temp += 1
						lowerCAmelCase__									=							int(n / 2 )
			if temp > 1:
						s *= (2**temp - 1) / (2 - 1)
			for i in range(3  ,		int(math.sqrt(UpperCamelCase_ ) ) + 1  ,		2 ):
						lowerCAmelCase__									=							1
						while n % i == 0:
									temp += 1
									lowerCAmelCase__									=							int(n / i )
						if temp > 1:
									s *= (i**temp - 1) / (i - 1)
			return int(UpperCamelCase_ )







def 					A       ( UpperCamelCase_   :       int )   ->    int:







			'''simple docstring'''



			lowerCAmelCase__									=							n
			for x in set(prime_factors(UpperCamelCase_ ) ):
						s *= (x - 1) / x
			return int(UpperCamelCase_ )


if __name__ == "__main__":
		import doctest

		doctest.testmod()





