
class 				_UpperCamelCase :






			'''simple docstring'''

			def __init__(				self       :				int					):
							# numbermap keys are the number and its values are lists of indexes sorted
							# in ascending order
							UpperCamelCase_:							dict[int, list[int]]		=  {}
							# indexmap keys are an index and it's values are the number at that index
							UpperCamelCase_:							dict[int, int]		=  {}

			def 					lowerCAmelCase__		(				self       :				Optional[Any]  ,		snake_case_       :				list | str | range  ,		snake_case_       :				int					):
							if isinstance(snake_case_  ,		(range, str)					):
											UpperCamelCase_:							Optional[Any]		=  list(snake_case_					)
							elif not isinstance(snake_case_  ,		snake_case_					):
											raise TypeError(
											    """binary_search_delete() only accepts either a list, range or str"""					)

							UpperCamelCase_:							List[Any]		=  0
							UpperCamelCase_:							Optional[int]		=  len(snake_case_					) - 1

							while low <= high:
											UpperCamelCase_:							List[Any]		=  (low + high) // 2
											if array[mid] == item:
															array.pop(snake_case_					)
															return array
											elif array[mid] < item:
															UpperCamelCase_:							str		=  mid + 1
											else:
															UpperCamelCase_:							List[Any]		=  mid - 1
							raise ValueError(
							    """Either the item is not in the array or the array was unsorted"""					)

			def 					lowerCAmelCase__		(				self       :				Optional[Any]  ,		snake_case_       :				list | str | range  ,		snake_case_       :				int					):
							if isinstance(snake_case_  ,		(range, str)					):
											UpperCamelCase_:							Tuple		=  list(snake_case_					)
							elif not isinstance(snake_case_  ,		snake_case_					):
											raise TypeError(
											    """binary_search_insert() only accepts either a list, range or str"""					)

							UpperCamelCase_:							int		=  0
							UpperCamelCase_:							Optional[Any]		=  len(snake_case_					) - 1

							while low <= high:
											UpperCamelCase_:							str		=  (low + high) // 2
											if array[mid] == index:
															# If the item already exists in the array,
															# insert it after the existing item
															array.insert(mid + 1  ,		snake_case_					)
															return array
											elif array[mid] < index:
															UpperCamelCase_:							List[Any]		=  mid + 1
											else:
															UpperCamelCase_:							Optional[int]		=  mid - 1

        # If the item doesn't exist in the array, insert it at the appropriate position
							array.insert(snake_case_  ,		snake_case_					)
							return array

			def 					lowerCAmelCase__		(				self       :				int  ,		snake_case_       :				int  ,		snake_case_       :				int					):
							# Remove previous index
							if index in self.indexmap:
											UpperCamelCase_:							Tuple		=  self.indexmap[index]
											if len(self.numbermap[n]					) == 1:
															del self.numbermap[n]
											else:
															UpperCamelCase_:							int		=  self.binary_search_delete(self.numbermap[n]  ,		snake_case_					)

        # Set new index
							UpperCamelCase_:							Union[str, Any]		=  number

							# Number not seen before or empty so insert number value
							if number not in self.numbermap:
											UpperCamelCase_:							Tuple		=  [index]

							# Here we need to perform a binary search insertion in order to insert
							# The item in the correct place
							else:
											UpperCamelCase_:							Dict		=  self.binary_search_insert(
											    self.numbermap[number]  ,		snake_case_					)




			def 					lowerCAmelCase__		(				self       :				List[str]  ,		snake_case_       :				int					):
							return self.numbermap.get(snake_case_  ,		[-1]					)[0]


if __name__ == "__main__":
							import doctest

							doctest.testmod()








def 				A__    (  lowerCamelCase  )     ->		Optional[Any]:
				UpperCamelCase_:							Optional[int]		=  len(lowerCamelCase  )
				for _ in range(
				    0   ,			int(((no_of_elements - 1) / 2) + 1  )  ):  # we don't need to traverse to end of list as
								for j in range(0   ,			no_of_elements - 1  ):
												if (
												    lst[j + 1] < lst[j]
												):  # applying bubble sort algorithm from left to right (or forwards)
																UpperCamelCase_:							str		=  lst[j + 1]
																UpperCamelCase_:							Tuple		=  lst[j]
																UpperCamelCase_:							str		=  temp
												if (
												    lst[no_of_elements - 1 - j] < lst[no_of_elements - 2 - j]
												):  # applying bubble sort algorithm from right to left (or backwards)
																UpperCamelCase_:							Union[str, Any]		=  lst[no_of_elements - 1 - j]
																UpperCamelCase_:							Dict		=  lst[no_of_elements - 2 - j]
																UpperCamelCase_:							List[Any]		=  temp
				return lst


if __name__ == "__main__":
							print("""enter the list to be sorted""")
							lowerCamelCase_  :       Union[str, Any]					      =     [int(x) for x in input().split()]  # inputing elements of the list in one line
							lowerCamelCase_  :       Union[str, Any]					      =     double_sort(lst)
							print("""the sorted list is""")
							print(sorted_lst)






