

from __future__ import annotations





def 							__a       (					__A	):







				if not list_of_ints:
								return []

				if min(lowercase_	) < 0:
								raise ValueError("All numbers must be positive"	)

				SCREAMING_SNAKE_CASE__					     =						max(len(bin(lowercase_	)[2:]	) for x in list_of_ints	)
				return _msd_radix_sort(lowercase_ ,       lowercase_	)





def 							__a       (					__A ,       __A	):







				if bit_position == 0 or len(lowercase_	) in [0, 1]:
								return list_of_ints

				SCREAMING_SNAKE_CASE__					     =						[]
				SCREAMING_SNAKE_CASE__					     =						[]
				# Split numbers based on bit at bit_position from the right
				for number in list_of_ints:
								if (number >> (bit_position - 1)) & 1:
												# number has a one at bit bit_position
												ones.append(lowercase_	)
								else:
												# number has a zero at bit bit_position
												zeros.append(lowercase_	)

    # recursively split both lists further
				SCREAMING_SNAKE_CASE__					     =						_msd_radix_sort(lowercase_ ,       bit_position - 1	)
				SCREAMING_SNAKE_CASE__					     =						_msd_radix_sort(lowercase_ ,       bit_position - 1	)

				# recombine lists
				SCREAMING_SNAKE_CASE__					     =						zeros
				res.extend(lowercase_	)

				return res





def 							__a       (					__A	):
				SCREAMING_SNAKE_CASE__					     =						len(lowercase_	)
				if not list_of_ints or length == 1:
								return

				if min(lowercase_	) < 0:
								raise ValueError("All numbers must be positive"	)

				SCREAMING_SNAKE_CASE__					     =						max(len(bin(lowercase_	)[2:]	) for x in list_of_ints	)
				_msd_radix_sort_inplace(lowercase_ ,       lowercase_ ,       0 ,       lowercase_	)





def 							__a       (					__A ,       __A ,       __A ,       __A	):







				if bit_position == 0 or end_index - begin_index <= 1:
								return

				bit_position -= 1

				SCREAMING_SNAKE_CASE__					     =						begin_index
				SCREAMING_SNAKE_CASE__					     =						end_index - 1
				while i <= j:
								SCREAMING_SNAKE_CASE__					     =						False
								if not (list_of_ints[i] >> bit_position) & 1:
												# found zero at the beginning
												i += 1
												SCREAMING_SNAKE_CASE__					     =						True
								if (list_of_ints[j] >> bit_position) & 1:
												# found one at the end
												j -= 1
												SCREAMING_SNAKE_CASE__					     =						True

								if changed:
												continue

								SCREAMING_SNAKE_CASE__     ,		SCREAMING_SNAKE_CASE__					     =						list_of_ints[j], list_of_ints[i]
								j -= 1
								if j != i:
												i += 1

				_msd_radix_sort_inplace(lowercase_ ,       lowercase_ ,       lowercase_ ,       lowercase_	)
				_msd_radix_sort_inplace(lowercase_ ,       lowercase_ ,       lowercase_ ,       lowercase_	)


if __name__ == "__main__":
		import doctest

		doctest.testmod()





def 							__a       (					__A ,       __A ,       __A	):
    SCREAMING_SNAKE_CASE__					     =						index
    SCREAMING_SNAKE_CASE__					     =						2 * index + 1
    SCREAMING_SNAKE_CASE__					     =						2 * index + 2
    if left_index < heap_size and unsorted[left_index] > unsorted[largest]:
        SCREAMING_SNAKE_CASE__					     =						left_index

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

    if largest != index:
        SCREAMING_SNAKE_CASE__     ,		SCREAMING_SNAKE_CASE__					     =						unsorted[index], unsorted[largest]
        heapify(__A ,       __A ,       __A	)





def 							__a       (					__A	):
    SCREAMING_SNAKE_CASE__					     =						len(__A	)
    for i in range(n // 2 - 1 ,       -1 ,       -1	):
        heapify(__A ,       __A ,       __A	)
    for i in range(n - 1 ,       0 ,       -1	):
        SCREAMING_SNAKE_CASE__     ,		SCREAMING_SNAKE_CASE__					     =						unsorted[i], unsorted[0]
        heapify(__A ,       0 ,       __A	)
    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))


