





def 							a__     (					_UpperCAmelCase		,       _UpperCAmelCase		,       _UpperCAmelCase		)      ->					int:

 '''simple docstring'''






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





def 							a__     (					_UpperCAmelCase		)      ->					Tuple:

 '''simple docstring'''






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


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








"""simple docstring"""


import math





def 							a__     (					_UpperCAmelCase		)      ->					list:

 '''simple docstring'''






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





def 							a__     (					_UpperCAmelCase		)      ->					int:

 '''simple docstring'''






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





def 							a__     (					_UpperCAmelCase		)      ->					int:

 '''simple docstring'''






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





def 							a__     (					_UpperCAmelCase		)      ->					int:

 '''simple docstring'''






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


if __name__ == "__main__":
   import doctest

   doctest.testmod()

