





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








"""simple docstring"""





from ..utils import DummyObject, requires_backends





class       snake_case		(       metaclass=__UpperCAmelCase       ):
      lowerCamelCase__      =			['''torch''', '''transformers''', '''invisible_watermark''']

      def __init__(      self       :Optional[int]						,							*_lowerCamelCase       :int						,							**_lowerCamelCase       :Any						):
       requires_backends(self						,							['''torch''', '''transformers''', '''invisible_watermark''']						)

      @classmethod
      def 						SCREAMING_SNAKE_CASE_      (      cls       :Dict						,							*_lowerCamelCase       :Optional[Any]						,							**_lowerCamelCase       :int						):
       requires_backends(cls						,							['''torch''', '''transformers''', '''invisible_watermark''']						)



      @classmethod
      def 						SCREAMING_SNAKE_CASE_      (      cls       :Optional[int]						,							*_lowerCamelCase       :Optional[Any]						,							**_lowerCamelCase       :Union[str, Any]						):
       requires_backends(cls						,							['''torch''', '''transformers''', '''invisible_watermark''']						)







class       snake_case		(       metaclass=__UpperCAmelCase       ):
      lowerCamelCase__      =			['''torch''', '''transformers''', '''invisible_watermark''']

      def __init__(      self       :Dict						,							*_lowerCamelCase       :Dict						,							**_lowerCamelCase       :Optional[Any]						):
       requires_backends(self						,							['''torch''', '''transformers''', '''invisible_watermark''']						)

      @classmethod
      def 						SCREAMING_SNAKE_CASE_      (      cls       :Optional[int]						,							*_lowerCamelCase       :int						,							**_lowerCamelCase       :Optional[int]						):
       requires_backends(cls						,							['''torch''', '''transformers''', '''invisible_watermark''']						)



      @classmethod
      def 						SCREAMING_SNAKE_CASE_      (      cls       :List[Any]						,							*_lowerCamelCase       :Dict						,							**_lowerCamelCase       :List[str]						):
       requires_backends(cls						,							['''torch''', '''transformers''', '''invisible_watermark''']						)

