



def 						_lowerCAmelCase    (					__lowerCamelCase :  Optional[Any]		,						__lowerCamelCase :  Optional[int]		,						__lowerCamelCase :  Optional[int]  ):



 """simple docstring"""





 __SCREAMING_SNAKE_CASE							:     List[Any]							=						index
 __SCREAMING_SNAKE_CASE							:     Optional[int]							=						2 * index + 1
 __SCREAMING_SNAKE_CASE							:     int							=						2 * index + 2
 if left_index < heap_size and unsorted[left_index] > unsorted[largest]:
  __SCREAMING_SNAKE_CASE							:     Tuple							=						left_index

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

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






def 						_lowerCAmelCase    (					__lowerCamelCase :  Optional[int]  ):



 """simple docstring"""





 __SCREAMING_SNAKE_CASE							:     Tuple							=						len(__lowerCamelCase  )
 for i in range(n // 2 - 1		,						-1		,						-1  ):
  heapify(__lowerCamelCase		,						__lowerCamelCase		,						__lowerCamelCase  )
 for i in range(n - 1		,						0		,						-1  ):
  __SCREAMING_SNAKE_CASE,		__SCREAMING_SNAKE_CASE							:     Optional[Any]							=						unsorted[i], unsorted[0]
  heapify(__lowerCamelCase		,						0		,						__lowerCamelCase  )
 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 dataclasses import dataclass
from typing import Callable, Optional

import datasets







@dataclass
class 						UpperCAmelCase						(		datasets.BuilderConfig):


 '''simple docstring'''




 __magic_name__       :			Optional[Callable]	=   None
 __magic_name__       :			Optional[dict]	=   None
 __magic_name__       :			Optional[datasets.Features]	=   None




 def    lowercase_	( self)			->   List[Any]:



      """simple docstring"""







      assert self.generator is not None, "generator must be specified"

      if self.gen_kwargs is None:
           a_									={}







class 						UpperCAmelCase						(		datasets.GeneratorBasedBuilder):


 '''simple docstring'''




 __magic_name__       :			Tuple	=   GeneratorConfig




 def    lowercase_	( self)			->   Tuple:



      """simple docstring"""







      return datasets.DatasetInfo(features=self.config.features)




 def    lowercase_	( self				,	lowerCAmelCase_)			->   int:



      """simple docstring"""







      return [datasets.SplitGenerator(name=datasets.Split.TRAIN				,	gen_kwargs=self.config.gen_kwargs)]




 def    lowercase_	( self				,	**lowerCAmelCase_)			->   List[Any]:



      """simple docstring"""







      for idx, ex in enumerate(self.config.generator(**lowerCAmelCase_)):
           yield idx, ex


