





"""simple docstring"""





class       snake_case		:

      def __init__(      self       :Optional[int]						,							_lowerCamelCase       :int						):
       __SCREAMING_SNAKE_CASE			:      Any 							=	data
       __SCREAMING_SNAKE_CASE			:      BinaryTreeNode | None 							=	None
       __SCREAMING_SNAKE_CASE			:      BinaryTreeNode | None 							=	None







def 		lowerCAmelCase_     (  lowercase_       :							BinaryTreeNode | None			,				lowercase_       :							int				):

 '''simple docstring'''






 if node is None:
  __SCREAMING_SNAKE_CASE			:      Any 							=	BinaryTreeNode(lowercase_				)
  return node

 # binary search tree is not empty,
 # so we will insert it into the tree
 # if new_value is less than value of data in node,
 #  add it to left subtree and proceed recursively
 if new_value < node.data:
  __SCREAMING_SNAKE_CASE			:      Any 							=	insert(node.left_child			,				lowercase_				)
 else:
  # if new_value is greater than value of data in node,
  #  add it to right subtree and proceed recursively
  __SCREAMING_SNAKE_CASE			:      int 							=	insert(node.right_child			,				lowercase_				)
 return node




def 		lowerCAmelCase_     (  lowercase_       :							None | BinaryTreeNode				):  # if node is None,return

 '''simple docstring'''






 if node:
  __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	inorder(node.left_child				)
  __SCREAMING_SNAKE_CASE			:      Tuple 							=	[*inorder_array, node.data]
  __SCREAMING_SNAKE_CASE			:      List[Any] 							=	inorder_array + inorder(node.right_child				)
 else:
  __SCREAMING_SNAKE_CASE			:      str 							=	[]
 return inorder_array




def 		lowerCAmelCase_     (  ):

 '''simple docstring'''






 __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	insert(lowercase_			,				15				)
 insert(lowercase_			,				10				)
 insert(lowercase_			,				25				)
 insert(lowercase_			,				6				)
 insert(lowercase_			,				14				)
 insert(lowercase_			,				20				)
 insert(lowercase_			,				60				)
 return root




def 		lowerCAmelCase_     (  ):

 '''simple docstring'''






 __SCREAMING_SNAKE_CASE			:      List[str] 							=	make_tree()
 print('''Printing values of binary search tree in Inorder Traversal.'''				)
 inorder(lowercase_				)


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    main()








"""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))

