



"""simple docstring"""

from __future__ import annotations







def 							SCREAMING_SNAKE_CASE__      (		SCREAMING_SNAKE_CASE__ :  list[int]			):  # This function is recursive



					"""simple docstring"""





					snake_case_					:		Any 					=					len(_lowerCamelCase			)
					# If the array contains only one element, we return it (it's the stop condition of
					# recursion)
					if array_length <= 1:
										return array
										# Else
					snake_case_					:		str 					=					array[0]
					snake_case_					:		int 					=					False
					snake_case_					:		int 					=					1
					snake_case_					:		list[int] 					=					[]
					while not is_found and i < array_length:
										if array[i] < pivot:
															snake_case_					:		Optional[Any] 					=					True
															snake_case_					:		Tuple 					=					[element for element in array[i:] if element >= array[i]]
															snake_case_					:		List[str] 					=					longest_subsequence(_lowerCamelCase			)
															if len(_lowerCamelCase			) > len(_lowerCamelCase			):
																				snake_case_					:		Optional[Any] 					=					temp_array
										else:
															i += 1

					snake_case_					:		Any 					=					[element for element in array[1:] if element >= pivot]
					snake_case_					:		str 					=					[pivot, *longest_subsequence(_lowerCamelCase			)]
					if len(_lowerCamelCase			) > len(_lowerCamelCase			):
										return temp_array
					else:
										return longest_subseq


if __name__ == "__main__":
			import doctest

			doctest.testmod()









"""simple docstring"""

def 							SCREAMING_SNAKE_CASE__      (		SCREAMING_SNAKE_CASE__ :  list			):



					"""simple docstring"""





					snake_case_					:		Optional[int] 					=					len(SCREAMING_SNAKE_CASE__			)
					for i in range(1				,    SCREAMING_SNAKE_CASE__			):
										snake_case_					:		Tuple 					=					collection[i]
										snake_case_					:		Tuple 					=					0
										snake_case_					:		str 					=					i - 1

										while low <= high:
															snake_case_					:		Optional[int] 					=					(low + high) // 2
															if val < collection[mid]:
																				snake_case_					:		List[str] 					=					mid - 1
															else:
																				snake_case_					:		str 					=					mid + 1
										for j in range(SCREAMING_SNAKE_CASE__				,    SCREAMING_SNAKE_CASE__				,    -1			):
															snake_case_					:		List[str] 					=					collection[j - 1]
										snake_case_					:		Any 					=					val
					return collection


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




