





"""simple docstring"""





from functools import lru_cache




@lru_cache
def 		lowerCAmelCase_     (  lowercase_       :							int				):

 '''simple docstring'''






 if not isinstance(lowercase_			,				lowercase_				):
  raise TypeError('''k must be an integer.'''				)
 if k < 0:
  raise ValueError('''k integer must be greater or equal to zero.'''				)
 if k == 0:
  return 0
 elif k == 1:
  return 1
 else:
  return fibonacci(k - 1				) + fibonacci(k - 2				)




def 		lowerCAmelCase_     (  lowercase_       :							list			,				lowercase_       :							int				):

 '''simple docstring'''






 __SCREAMING_SNAKE_CASE			:      int 							=	len(lowercase_				)
 # Find m such that F_m >= n where F_i is the i_th fibonacci number.
 __SCREAMING_SNAKE_CASE			:      Dict 							=	0
 while True:
  if fibonacci(lowercase_				) >= len_list:
   __SCREAMING_SNAKE_CASE			:      str 							=	i
   break
  i += 1
 __SCREAMING_SNAKE_CASE			:      Tuple 							=	0
 while fibb_k > 0:
  __SCREAMING_SNAKE_CASE			:      Union[str, Any] 							=	min(
      offset + fibonacci(fibb_k - 1				)			,				len_list - 1				)  # Prevent out of range
  __SCREAMING_SNAKE_CASE			:      str 							=	arr[index_k]
  if item_k_1 == val:
   return index_k
  elif val < item_k_1:
   fibb_k -= 1
  elif val > item_k_1:
   offset += fibonacci(fibb_k - 1				)
   fibb_k -= 2
 else:
  return -1


if __name__ == "__main__":
    import doctest

    doctest.testmod()








"""simple docstring"""





def 		lowerCAmelCase_     (  lowercase_       :							Tuple			,				lowercase_       :							Any			,				lowercase_       :							List[str]		):

 '''simple docstring'''






 __SCREAMING_SNAKE_CASE			:      Any 							=	index
 __SCREAMING_SNAKE_CASE			:      Union[str, Any] 							=	2 * index + 1
 __SCREAMING_SNAKE_CASE			:      Any 							=	2 * index + 2
 if left_index < heap_size and unsorted[left_index] > unsorted[largest]:
  __SCREAMING_SNAKE_CASE			:      str 							=	left_index

 if right_index < heap_size and unsorted[right_index] > unsorted[largest]:
  __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	right_index

 if largest != index:
  __SCREAMING_SNAKE_CASE							,				__SCREAMING_SNAKE_CASE			:      List[str] 							=	unsorted[index], unsorted[largest]
  heapify(lowercase_			,				lowercase_			,				lowercase_		)




def 		lowerCAmelCase_     (  lowercase_       :							List[Any]		):

 '''simple docstring'''






 __SCREAMING_SNAKE_CASE			:      Dict 							=	len(lowercase_		)
 for i in range(n // 2 - 1			,				-1			,				-1		):
  heapify(lowercase_			,				lowercase_			,				lowercase_		)
 for i in range(n - 1			,				0			,				-1		):
  __SCREAMING_SNAKE_CASE							,				__SCREAMING_SNAKE_CASE			:      List[Any] 							=	unsorted[i], unsorted[0]
  heapify(lowercase_			,				0			,				lowercase_		)
 return unsorted


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

