





"""simple docstring"""



class 	__snake_case      :





	"""simple docstring"""


	def __init__(					self						):



					'''simple docstring'''




					__A					:		int						=  {}
					# indexmap keys are an index and it's values are the number at that index
					__A					:		Optional[int]						=  {}

	def       UpperCamelCase__(					self      ,		__lowerCamelCase      ,		__lowerCamelCase						):



					'''simple docstring'''




					if isinstance(__UpperCamelCase      ,		(range, str)						):
									__A					:		int						=  list(__UpperCamelCase						)
					elif not isinstance(__UpperCamelCase      ,		__UpperCamelCase						):
									raise TypeError(
									    '''binary_search_delete() only accepts either a list, range or str'''						)

					__A					:		Optional[Any]						=  0
					__A					:		List[str]						=  len(__UpperCamelCase						) - 1

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

	def       UpperCamelCase__(					self      ,		__lowerCamelCase      ,		__lowerCamelCase						):



					'''simple docstring'''




					if isinstance(__UpperCamelCase      ,		(range, str)						):
									__A					:		Dict						=  list(__UpperCamelCase						)
					elif not isinstance(__UpperCamelCase      ,		__UpperCamelCase						):
									raise TypeError(
									    '''binary_search_insert() only accepts either a list, range or str'''						)

					__A					:		Optional[Any]						=  0
					__A					:		Optional[Any]						=  len(__UpperCamelCase						) - 1

					while low <= high:
									__A					:		Dict						=  (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      ,		__UpperCamelCase						)
													return array
									elif array[mid] < index:
													__A					:		List[Any]						=  mid + 1
									else:
													__A					:		List[Any]						=  mid - 1

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

	def       UpperCamelCase__(					self      ,		__lowerCamelCase      ,		__lowerCamelCase						):



					'''simple docstring'''




					if index in self.indexmap:
									__A					:		Optional[int]						=  self.indexmap[index]
									if len(self.numbermap[n]						) == 1:
													del self.numbermap[n]
									else:
													__A					:		Optional[Any]						=  self.binary_search_delete(self.numbermap[n]      ,		__UpperCamelCase						)

        # Set new index
					__A					:		List[str]						=  number

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

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







	def       UpperCamelCase__(					self      ,		__lowerCamelCase						):



					'''simple docstring'''




					return self.numbermap.get(__UpperCamelCase      ,		[-1]						)[0]


if __name__ == "__main__":
							import doctest

							doctest.testmod()











"""simple docstring"""



def 	__lowercase  (     snake_case_						:						Union[str, Any]		)     ->Optional[int]:



    '''simple docstring'''







    __A					:		Dict						=  [701, 301, 132, 57, 23, 10, 4, 1]
    for gap in gaps:
        for i in range(snake_case_       ,len(snake_case_		)		):
            __A					:		Tuple						=  collection[i]
            __A					:		Union[str, Any]						=  i
            while j >= gap and collection[j - gap] > insert_value:
                __A					:		Optional[int]						=  collection[j - gap]
                j -= gap
            if j != i:
                __A					:		Optional[int]						=  insert_value
    return collection


if __name__ == "__main__":
       from doctest import testmod

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




