




'''simple docstring'''






def 			snake_case_					( _lowerCAmelCase  :						List[str]       ,				_lowerCAmelCase  :						Union[str, Any]       ,				_lowerCAmelCase  :						Any  )				->       Optional[int]:
							UpperCAmelCase			:	str										=		index
							UpperCAmelCase			:	Tuple										=		2 * index + 1
							UpperCAmelCase			:	List[str]										=		2 * index + 2
							if left_index < heap_size and unsorted[left_index] > unsorted[largest]:
														UpperCAmelCase			:	List[Any]										=		left_index

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

							if largest != index:
														UpperCAmelCase			:	Union[str, Any]										=		unsorted[index], unsorted[largest]
														heapify(_lowerCAmelCase       ,				_lowerCAmelCase       ,				_lowerCAmelCase  )


def 			snake_case_					( _lowerCAmelCase  :						Optional[Any]  )				->       Optional[Any]:
							UpperCAmelCase			:	str										=		len(_lowerCAmelCase  )
							for i in range(n // 2 - 1       ,				-1       ,				-1  ):
														heapify(_lowerCAmelCase       ,				_lowerCAmelCase       ,				_lowerCAmelCase  )
							for i in range(n - 1       ,				0       ,				-1  ):
														UpperCAmelCase			:	Optional[int]										=		unsorted[i], unsorted[0]
														heapify(_lowerCAmelCase       ,				0       ,				_lowerCAmelCase  )
							return unsorted


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










'''simple docstring'''






import re


def 			snake_case_					( _lowerCAmelCase  :						List[str]  )				->       Dict:
							def docstring_decorator(_lowerCAmelCase  :						List[str]  ):
														UpperCAmelCase			:	str										=		fn.__doc__
														UpperCAmelCase			:	List[str]										=		func_doc.split('''\n'''  )
														UpperCAmelCase			:	Optional[Any]										=		0
														while i < len(_lowerCAmelCase  ) and re.search(R'''^\s*Examples?:\s*$'''       ,				lines[i]  ) is None:
																					i += 1
														if i < len(_lowerCAmelCase  ):
																					UpperCAmelCase			:	Union[str, Any]										=		example_docstring
																					UpperCAmelCase			:	Tuple										=		'''\n'''.join(_lowerCAmelCase  )
														else:
																					raise ValueError(
																					    f"""The function {fn} should have an empty 'Examples:' in its docstring as placeholder, """
																					    f"""current docstring is:\n{func_doc}"""  )
														UpperCAmelCase			:	Any										=		func_doc
														return fn

							return docstring_decorator





