





def 			__UpperCamelCase  (_SCREAMING_SNAKE_CASE		,						_SCREAMING_SNAKE_CASE		,						_SCREAMING_SNAKE_CASE		)				->   Dict:
  lowercase__				=  index
  lowercase__				=  2 * index + 1
  lowercase__				=  2 * index + 2
  if left_index < heap_size and unsorted[left_index] > unsorted[largest]:
    lowercase__				=  left_index

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

  if largest != index:
    lowercase__			,    lowercase__				=  unsorted[index], unsorted[largest]
    heapify(UpperCamelCase_		,						UpperCamelCase_		,						UpperCamelCase_		)




def 			__UpperCamelCase  (_SCREAMING_SNAKE_CASE		)				->   Optional[Any]:
  lowercase__				=  len(UpperCamelCase_		)
  for i in range(n // 2 - 1		,						-1		,						-1		):
    heapify(UpperCamelCase_		,						UpperCamelCase_		,						UpperCamelCase_		)
  for i in range(n - 1		,						0		,						-1		):
    lowercase__			,    lowercase__				=  unsorted[i], unsorted[0]
    heapify(UpperCamelCase_		,						0		,						UpperCamelCase_		)
  return unsorted


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









def        lowerCAmelCase_       (							UpperCamelCase_    ,						UpperCamelCase_     )   ->						list:
       UpperCamelCase_      				=     sorted(UpperCamelCase_    ,						key=lambda UpperCamelCase_     : value[2]    ,						reverse=UpperCamelCase_     )

       # Create a list of size equal to the maximum deadline
       # and initialize it with -1
       UpperCamelCase_      				=     max(UpperCamelCase_    ,						key=lambda UpperCamelCase_     : value[1]     )[1]
       UpperCamelCase_      				=     [-1] * max_deadline

       # Finding the maximum profit and the count of jobs
       UpperCamelCase_      				=     0
       UpperCamelCase_      				=     0
       for job in jobs:
              # Find a free time slot for this job
              # (Note that we start from the last possible slot)
              for i in range(job[1] - 1    ,						-1    ,						-1     ):
                     if time_slots[i] == -1:
                            UpperCamelCase_      				=     job[0]
                            count += 1
                            max_profit += job[2]
                            break
       return [count, max_profit]


if __name__ == "__main__":
     import doctest

     doctest.testmod()

