"""simple docstring"""







class      _lowercase						:


				class      _lowercase						:
								lowerCamelCase__									=    '_prev', '_data', '_next'

								def __init__(       self    :      Optional[Any]    ,      _lowercase    :      List[str]    ,      _lowercase    :      List[Any]    ,      _lowercase    :      int       ):


														'''simple docstring'''
														UpperCAmelCase__   		=						link_p
														UpperCAmelCase__   		=						element
														UpperCAmelCase__   		=						link_n

								def     A	(       self    :      Optional[int]       ):


														'''simple docstring'''
														return (
														    f' Prev -> {self._prev is not None}, Next -> {self._next is not None}'
														)

				def __init__(       self    :      int       ):


										'''simple docstring'''
										UpperCAmelCase__   		=						self._Node(_lowercase    ,      _lowercase    ,      _lowercase       )
										UpperCAmelCase__   		=						self._Node(_lowercase    ,      _lowercase    ,      _lowercase       )
										UpperCAmelCase__   		=						self._trailer
										UpperCAmelCase__   		=						self._header
										UpperCAmelCase__   		=						0

				def __len__(       self    :      int       ):


										'''simple docstring'''
										return self._size

				def     A	(       self    :      Any       ):


										'''simple docstring'''
										return self.__len__() == 0

				def     A	(       self    :      Any    ,      _lowercase    :      List[str]    ,      _lowercase    :      Optional[int]    ,      _lowercase    :      int       ):


										'''simple docstring'''
										# Create new_node by setting it's prev.link -> header
										# setting it's next.link -> trailer
										UpperCAmelCase__   		=						self._Node(_lowercase    ,      _lowercase    ,      _lowercase       )
										UpperCAmelCase__   		=						new_node
										UpperCAmelCase__   		=						new_node
										self._size += 1
										return self

				def     A	(       self    :      Any    ,      _lowercase    :      Dict       ):


										'''simple docstring'''
										UpperCAmelCase__   		=						node._prev
										UpperCAmelCase__   		=						node._next

										UpperCAmelCase__   		=						successor
										UpperCAmelCase__   		=						predecessor
										self._size -= 1
										UpperCAmelCase__   		=						node._data
										UpperCAmelCase__   		=						UpperCAmelCase__   		=						UpperCAmelCase__   		=						None
										del node
										return temp


class      _lowercase						(				_DoublyLinkedBase					):

				def     A	(       self    :      Dict       ):


										'''simple docstring'''
										if self.is_empty():
																raise Exception("""List is empty"""       )
										return self._header._next._data

				def     A	(       self    :      Optional[Any]       ):


										'''simple docstring'''
										if self.is_empty():
																raise Exception("""List is empty"""       )
										return self._trailer._prev._data

				def     A	(       self    :      List[str]    ,      _lowercase    :      Union[str, Any]       ):


										'''simple docstring'''
										return self._insert(self._header    ,      _lowercase    ,      self._header._next       )

				def     A	(       self    :      str    ,      _lowercase    :      Optional[Any]       ):


										'''simple docstring'''
										return self._insert(self._trailer._prev    ,      _lowercase    ,      self._trailer       )

				def     A	(       self    :      List[Any]       ):


										'''simple docstring'''
										if self.is_empty():
																raise IndexError("""remove_first from empty list"""       )
										return self._delete(self._header._next       )

				def     A	(       self    :      Optional[int]       ):


										'''simple docstring'''
										if self.is_empty():
																raise IndexError("""remove_first from empty list"""       )
										return self._delete(self._trailer._prev       )


"""simple docstring"""







def 					a__ (						UpperCAmelCase__    :     List[Any]     )->		Dict:
						UpperCAmelCase__   		=						[7_0_1, 3_0_1, 1_3_2, 5_7, 2_3, 1_0, 4, 1]
						for gap in gaps:
												for i in range(UpperCAmelCase__						,     len(UpperCAmelCase__     )     ):
																		UpperCAmelCase__   		=						collection[i]
																		UpperCAmelCase__   		=						i
																		while j >= gap and collection[j - gap] > insert_value:
																								UpperCAmelCase__   		=						collection[j - gap]
																								j -= gap
																		if j != i:
																								UpperCAmelCase__   		=						insert_value
						return collection


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

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

