
def 	_a  (					__SCREAMING_SNAKE_CASE					:  List[str]    ):






  """simple docstring"""




  _lowerCAmelCase						=		[701, 301, 132, 57, 23, 10, 4, 1]
  for gap in gaps:
    for i in range(__SCREAMING_SNAKE_CASE		,				len(__SCREAMING_SNAKE_CASE    )    ):
      _lowerCAmelCase						=		collection[i]
      _lowerCAmelCase						=		i
      while j >= gap and collection[j - gap] > insert_value:
        _lowerCAmelCase						=		collection[j - gap]
        j -= gap
      if j != i:
        _lowerCAmelCase						=		insert_value
  return collection


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

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




'''simple docstring'''

from __future__ import annotations

import random
from collections.abc import Iterable
from typing import Any, Generic, TypeVar

_UpperCAmelCase					:			Any				     =					TypeVar("""T""", bound=bool)


class    a__					(			Generic[T]   ):







				"""simple docstring"""



				def __init__(self							,      __lowercase		):
										__lowerCAmelCase											=					value
										__lowerCAmelCase											=					None
										__lowerCAmelCase											=					None




				@property
				def        _snake_case	(self		):
										return self._value




				@staticmethod
				def        _snake_case	(__lowercase							,      __lowercase		):
										if not roota:
																return roota

										if not roota:
																return roota

										if roota.value > roota.value:
																__lowerCAmelCase							,       __lowerCAmelCase											=					roota, roota

										if random.choice([True, False]		):
																__lowerCAmelCase							,       __lowerCAmelCase											=					roota.right, roota.left

										__lowerCAmelCase											=					RandomizedHeapNode.merge(roota.left							,      __lowercase		)

										return roota


class    a__					(			Generic[T]   ):







				"""simple docstring"""



				def __init__(self							,      __lowercase = ()		):
										__lowerCAmelCase											=					None

										if data:
																for item in data:
																						self.insert(__lowercase		)




				def        _snake_case	(self							,      __lowercase		):
										__lowerCAmelCase											=					RandomizedHeapNode.merge(self._root							,      RandomizedHeapNode(__lowercase		)		)




				def        _snake_case	(self		):
										__lowerCAmelCase											=					self.top()

										if self._root is None:
																return None

										__lowerCAmelCase											=					RandomizedHeapNode.merge(self._root.left							,      self._root.right		)

										return result




				def        _snake_case	(self		):
										if not self._root:
																raise IndexError('''Can\'t get top element for the empty heap.'''		)
										return self._root.value




				def        _snake_case	(self		):
										__lowerCAmelCase											=					None




				def        _snake_case	(self		):
										__lowerCAmelCase											=					[]
										while self:
																result.append(self.pop()		)

										return result




				def __bool__(self		):
										return self._root is not None


if __name__ == "__main__":
	import doctest

	doctest.testmod()

