
'''simple docstring'''





from __future__ import annotations

def   A			(							A_				:       List[Any]     ,				A_				:       List[Any]							):
						snake_case							:  Union[str, Any]			=     0
						snake_case							:  Any			=     len(A_							) - 1
						while left <= right:
												snake_case							:  str			=     (left + right) // 2
												if left == right:
																		if sorted_list[middle] < item:
																								snake_case							:  Any			=     middle + 1
																		break
												elif sorted_list[middle] < item:
																		snake_case							:  List[Any]			=     middle + 1
												else:
																		snake_case							:  str			=     middle - 1
						sorted_list.insert(A_     ,				A_							)
						return sorted_list

def   A			(							A_				:       Dict     ,				A_				:       Optional[int]							):
						snake_case							:  Any			=     []
						while left and right:
												if left[0][0] < right[0][0]:
																		result.append(left.pop(0							)							)
												else:
																		result.append(right.pop(0							)							)
						return result + left + right

def   A			(							A_				:       Any							):
						snake_case							:  Any			=     len(A_							)
						if length <= 1:
												return list_ad
						snake_case							:  List[str]			=     length // 2
						return merge(sortlist_ad(list_ad[:middle]							)     ,				sortlist_ad(list_ad[middle:]							)							)

def   A			(							A_				:       list[int]							):

						if len(A_							) <= 1:
												return collection
						snake_case							:  List[Any]			=     []
						snake_case							:  Union[str, Any]			=     False
						for i in range(0     ,				len(A_							)     ,				2							):
												if i == len(A_							) - 1:
																		snake_case							:  Tuple			=     True
												else:
																		if collection[i] < collection[i + 1]:
																								two_paired_list.append([collection[i], collection[i + 1]]							)
																		else:
																								two_paired_list.append([collection[i + 1], collection[i]]							)
						snake_case							:  Dict			=     sortlist_ad(A_							)
						snake_case							:  List[Any]			=     [i[0] for i in sorted_list_ad]
						result.append(sorted_list_ad[-1][1]							)
						if has_last_odd_item:
												snake_case							:  Dict			=     collection[-1]
												snake_case							:  Optional[Any]			=     binary_search_insertion(A_     ,				A_							)
						snake_case							:  Union[str, Any]			=     False
						for i in range(len(A_							) - 1							):
												if result[i] == collection[-1] and has_last_odd_item:
																		snake_case							:  Dict			=     True
												snake_case							:  Any			=     sorted_list_ad[i][1]
												# If last_odd_item is inserted before the item's index,
												# you should forward index one more.
												if is_last_odd_item_inserted_before_this_index:
																		snake_case							:  Any			=     result[: i + 2] + binary_search_insertion(result[i + 2 :]     ,				A_							)
												else:
																		snake_case							:  Optional[int]			=     result[: i + 1] + binary_search_insertion(result[i + 1 :]     ,				A_							)

						return result


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









def    a__    (	A       ):
   return int(A       ) if x - int(A       ) >= 0 else int(A       ) - 1


if __name__ == "__main__":
 import doctest

 doctest.testmod()


