

"""simple docstring"""




# Lint as: python3

import hashlib
from typing import Union
def   __SCREAMING_SNAKE_CASE		(		lowercase__ ):
					"""simple docstring"""
					if isinstance(lowercase__     ,				lowercase__ ):
										# Data already in bytes, returns as it as
										return hash_data
					elif isinstance(lowercase__     ,				lowercase__ ):
										# We keep the data as it as for it ot be later encoded to UTF-8
										# However replace `\\` with `/` for Windows compatibility
										A     =   hash_data.replace("\\"     ,				"/" )
					elif isinstance(lowercase__     ,				lowercase__ ):
										A     =   str(lowercase__ )
					else:
										# If data is not of the required type, raise error
										raise InvalidKeyError(lowercase__ )

					return hash_data.encode("utf-8" )





class      __UpperCamelCase					(  _A		):


		def __init__(self					:						List[Any]	,	__SCREAMING_SNAKE_CASE					:						int):
							A     =   "\nFAILURE TO GENERATE DATASET: Invalid key type detected"
							A     =   F"""\nFound Key {hash_data} of type {type(__SCREAMING_SNAKE_CASE)}"""
							A     =   "\nKeys should be either str, int or bytes type"
							super().__init__(F"""{self.prefix}{self.err_msg}{self.suffix}""")





class      __UpperCamelCase					(  _A		):


		def __init__(self					:						Optional[Any]	,	__SCREAMING_SNAKE_CASE					:						Tuple	,	__SCREAMING_SNAKE_CASE					:						Tuple	,	__SCREAMING_SNAKE_CASE					:						int=""):
							A     =   key
							A     =   duplicate_key_indices
							A     =   fix_msg
							A     =   "Found multiple examples generated with the same key"
							if len(__SCREAMING_SNAKE_CASE) <= 2_0:
												A     =   F"""\nThe examples at index {", ".join(__SCREAMING_SNAKE_CASE)} have the key {key}"""
							else:
												A     =   F"""\nThe examples at index {", ".join(duplicate_key_indices[:2_0])}... ({len(__SCREAMING_SNAKE_CASE) - 2_0} more) have the key {key}"""
							A     =   "\n" + fix_msg if fix_msg else ""
							super().__init__(F"""{self.prefix}{self.err_msg}{self.suffix}""")





class      __UpperCamelCase					:


		def __init__(self					:						Tuple	,	__SCREAMING_SNAKE_CASE					:						str):
							A     =   hashlib.mda(_as_bytes(__SCREAMING_SNAKE_CASE))


		def    SCREAMING_SNAKE_CASE__  (self					:						Optional[int]	,	__SCREAMING_SNAKE_CASE					:						Union[str, int, bytes]):
							A     =   self._split_mda.copy()
							A     =   _as_bytes(__SCREAMING_SNAKE_CASE)
							mda.update(__SCREAMING_SNAKE_CASE)
							# Convert to integer with hexadecimal conversion
							return int(mda.hexdigest()	,	1_6)








def  snake_case_(_UpperCamelCase					,			_UpperCamelCase					,			_UpperCamelCase	)				->      Optional[Any]:



  """simple docstring"""






  _snake_case		=				index
  _snake_case		=				2 * index + 1
  _snake_case		=				2 * index + 2
  if left_index < heap_size and unsorted[left_index] > unsorted[largest]:
    _snake_case		=				left_index

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

  if largest != index:
    _snake_case,	_snake_case		=				unsorted[index], unsorted[largest]
    heapify(_UpperCamelCase					,			_UpperCamelCase					,			_UpperCamelCase	)



def  snake_case_(_UpperCamelCase	)				->      Any:



  """simple docstring"""






  _snake_case		=				len(_UpperCamelCase	)
  for i in range(n // 2 - 1					,			-1					,			-1	):
    heapify(_UpperCamelCase					,			_UpperCamelCase					,			_UpperCamelCase	)
  for i in range(n - 1					,			0					,			-1	):
    _snake_case,	_snake_case		=				unsorted[i], unsorted[0]
    heapify(_UpperCamelCase					,			0					,			_UpperCamelCase	)
  return unsorted


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

