


'''simple docstring'''







from dataclasses import dataclass

A__:   Optional[Any]    =	'''0.1'''
A__:   List[Any]    =	'''Lucia Harcekova'''







@dataclass
class A__	:
						__UpperCamelCase	:  int
						__UpperCamelCase	:  int
						__UpperCamelCase	:  str






						def __repr__(			self      :Tuple     )	-> str:




													'''simple docstring'''
													return f"({self.offset}, {self.length}, {self.indicator})"







class A__	:






						def __init__(			self      :Dict					,						SCREAMING_SNAKE_CASE      :int = 1_3					,						SCREAMING_SNAKE_CASE      :int = 6     )	-> None:




													'''simple docstring'''
													_a   :			Dict					 =window_size
													_a   :			Optional[int]					 =lookahead_buffer_size
													_a   :			List[str]					 =self.window_size - self.lookahead_buffer_size






						def __UpperCAmelCase	(			self      :List[str]					,						SCREAMING_SNAKE_CASE      :str     )	-> list[Token]:




													'''simple docstring'''
													_a   :			Any					 =[]
													_a   :			int					 =""""""

													# while there are still characters in text to compress
													while text:
																				# find the next encoding phrase
																				# - triplet with offset, length, indicator (the next encoding character)
																				_a   :			Dict					 =self._find_encoding_token(SCREAMING_SNAKE_CASE					,						SCREAMING_SNAKE_CASE     )

																				# update the search buffer:
																				# - add new characters from text into it
																				# - check if size exceed the max search buffer size, if so, drop the
																				#   oldest elements
																				search_buffer += text[: token.length + 1]
																				if len(SCREAMING_SNAKE_CASE     ) > self.search_buffer_size:
																											_a   :			str					 =search_buffer[-self.search_buffer_size :]

																				# update the text
																				_a   :			int					 =text[token.length + 1 :]

																				# append the token to output
																				output.append(SCREAMING_SNAKE_CASE     )

													return output






						def __UpperCAmelCase	(			self      :Dict					,						SCREAMING_SNAKE_CASE      :list[Token]     )	-> str:




													'''simple docstring'''
													_a   :			Union[str, Any]					 =""""""

													for token in tokens:
																				for _ in range(token.length     ):
																											output += output[-token.offset]
																				output += token.indicator

													return output






						def __UpperCAmelCase	(			self      :Optional[int]					,						SCREAMING_SNAKE_CASE      :str					,						SCREAMING_SNAKE_CASE      :str     )	-> Token:




													'''simple docstring'''

													if not text:
																				raise ValueError("""We need some text to work with."""     )

													# Initialise result parameters to default values
													_a   :			List[Any]					 =0, 0

													if not search_buffer:
																				return Token(SCREAMING_SNAKE_CASE					,						SCREAMING_SNAKE_CASE					,						text[length]     )

													for i, character in enumerate(SCREAMING_SNAKE_CASE     ):
																				_a   :			int					 =len(SCREAMING_SNAKE_CASE     ) - i
																				if character == text[0]:
																											_a   :			Dict					 =self._match_length_from_index(SCREAMING_SNAKE_CASE					,						SCREAMING_SNAKE_CASE					,						0					,						SCREAMING_SNAKE_CASE     )
																											# if the found length is bigger than the current or if it's equal,
																											# which means it's offset is smaller: update offset and length
																											if found_length >= length:
																																		_a   :			str					 =found_offset, found_length

													return Token(SCREAMING_SNAKE_CASE					,						SCREAMING_SNAKE_CASE					,						text[length]     )






						def __UpperCAmelCase	(			self      :str					,						SCREAMING_SNAKE_CASE      :str					,						SCREAMING_SNAKE_CASE      :str					,						SCREAMING_SNAKE_CASE      :int					,						SCREAMING_SNAKE_CASE      :int     )	-> int:




													'''simple docstring'''
													if not text or text[text_index] != window[window_index]:
																				return 0
													return 1 + self._match_length_from_index(
													    SCREAMING_SNAKE_CASE					,						window + text[text_index]					,						text_index + 1					,						window_index + 1     )


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

			testmod()
			# Initialize compressor class
			A__:   Any    =	LZaaCompressor(window_size=13, lookahead_buffer_size=6)

			# Example
			A__:   int    =	'''cabracadabrarrarrad'''
			A__:   Union[str, Any]    =	lzaa_compressor.compress(TEXT)
			print(lzaa_compressor.compress('''ababcbababaa'''))
			A__:   Optional[int]    =	lzaa_compressor.decompress(compressed_text)
			assert decompressed_text == TEXT, "The LZ77 algorithm returned the invalid result."






'''simple docstring'''







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


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

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


