

'''simple docstring'''
def       _A	(			snake_case	,							snake_case	,							snake_case  )    ->			int:
   _lowercase    :   str      =     index
   _lowercase    :   Union[str, Any]      =     2 * index + 1
   _lowercase    :   List[str]      =     2 * index + 2
   if left_index < heap_size and unsorted[left_index] > unsorted[largest]:
      _lowercase    :   Tuple      =     left_index

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

   if largest != index:
      _lowercase  ,   _lowercase    :   str      =     unsorted[index], unsorted[largest]
      heapify(snake_case	,							snake_case	,							snake_case  )







def       _A	(			snake_case  )    ->			List[Any]:
   _lowercase    :   Optional[int]      =     len(snake_case  )
   for i in range(n // 2 - 1	,							-1	,							-1  ):
      heapify(snake_case	,							snake_case	,							snake_case  )
   for i in range(n - 1	,							0	,							-1  ):
      _lowercase  ,   _lowercase    :   Optional[int]      =     unsorted[i], unsorted[0]
      heapify(snake_case	,							0	,							snake_case  )
   return unsorted


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









'''simple docstring'''
def       _A	(			snake_case  )    ->			list:
   _lowercase    :   Optional[Any]      =     1.3
   _lowercase    :   Optional[Any]      =     len(snake_case  )
   _lowercase    :   Optional[int]      =     False

   while not completed:
      # Update the gap value for a next comb
      _lowercase    :   Tuple      =     int(gap / shrink_factor  )
      if gap <= 1:
         _lowercase    :   List[str]      =     True

      _lowercase    :   Optional[int]      =     0
      while index + gap < len(snake_case  ):
         if data[index] > data[index + gap]:
            # Swap values
            _lowercase  ,   _lowercase    :   Any      =     data[index + gap], data[index]
            _lowercase    :   Tuple      =     False
         index += 1

   return data


if __name__ == "__main__":
    import doctest

    doctest.testmod()

    _snake_case     						=						input('Enter numbers separated by a comma:\n').strip()
    _snake_case     						=						[int(item) for item in user_input.split(',')]
    print(comb_sort(unsorted))






