





"""simple docstring"""





# tests directory-specific settings - this file is run automatically
# by pytest before any tests are run

import sys
import warnings
from os.path import abspath, dirname, join


# allow having multiple repository checkouts and not needing to remember to rerun
# 'pip install -e .[dev]' when switching between checkouts and running tests.
_lowerCamelCase  					=     abspath(join(dirname(dirname(dirname(__file__))), '''src'''))
sys.path.insert(1, git_repo_path)


# silence FutureWarning warnings in tests since often we can't act on them until
# they become normal warnings - i.e. the tests still need to test the current functionality
warnings.simplefilter(action='''ignore''', category=FutureWarning)




def 		lowerCAmelCase_     (  lowercase_       :							str		):

 '''simple docstring'''






 from diffusers.utils.testing_utils import pytest_addoption_shared

 pytest_addoption_shared(lowercase_		)






def 		lowerCAmelCase_     (  lowercase_       :							Dict		):

 '''simple docstring'''






 from diffusers.utils.testing_utils import pytest_terminal_summary_main

 __SCREAMING_SNAKE_CASE			:      Any 							=	terminalreporter.config.getoption('''--make-reports'''		)
 if make_reports:
  pytest_terminal_summary_main(lowercase_			,				id=lowercase_		)








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

