



'''simple docstring'''



from dataclasses import dataclass

_lowercase       :						Any						="0.1"
_lowercase       :						Optional[int]						="Lucia Harcekova"






@dataclass
class 			_SCREAMING_SNAKE_CASE				:
			A__								=  42
			A__								=  42
			A__								=  42



			def __repr__(     self		:						Union[str, Any]			)      ->      str:
							"""simple docstring"""





							return F'''({self.offset}, {self.length}, {self.indicator})'''






class 			_SCREAMING_SNAKE_CASE				:



			def __init__(     self		:						Union[str, Any]    ,			__UpperCamelCase		:						int = 13    ,			__UpperCamelCase		:						int = 6			)      ->      None:
							"""simple docstring"""





							snake_case__      :   List[str]      =    window_size
							snake_case__      :   Optional[Any]      =    lookahead_buffer_size
							snake_case__      :   Any      =    self.window_size - self.lookahead_buffer_size



			def 				lowerCAmelCase (     self		:						List[str]    ,			__UpperCamelCase		:						str			)      ->      list[Token]:
							"""simple docstring"""





							snake_case__      :   Any      =    []
							snake_case__      :   List[Any]      =    ''''''

							# 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)
											snake_case__      :   int      =    self._find_encoding_token(__UpperCamelCase    ,			__UpperCamelCase			)

											# 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(__UpperCamelCase			) > self.search_buffer_size:
															snake_case__      :   Dict      =    search_buffer[-self.search_buffer_size :]

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

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

							return output



			def 				lowerCAmelCase (     self		:						Union[str, Any]    ,			__UpperCamelCase		:						list[Token]			)      ->      str:
							"""simple docstring"""





							snake_case__      :   Any      =    ''''''

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

							return output



			def 				lowerCAmelCase (     self		:						Any    ,			__UpperCamelCase		:						str    ,			__UpperCamelCase		:						str			)      ->      Token:
							"""simple docstring"""





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

							# Initialise result parameters to default values
							snake_case__  ,      snake_case__      :   Any      =    0, 0

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

							for i, character in enumerate(__UpperCamelCase			):
											snake_case__      :   List[Any]      =    len(__UpperCamelCase			) - i
											if character == text[0]:
															snake_case__      :   Union[str, Any]      =    self._match_length_from_index(__UpperCamelCase    ,			__UpperCamelCase    ,			0    ,			__UpperCamelCase			)
															# 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:
																			snake_case__  ,      snake_case__      :   Dict      =    found_offset, found_length

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







			def 				lowerCAmelCase (     self		:						Union[str, Any]    ,			__UpperCamelCase		:						str    ,			__UpperCamelCase		:						str    ,			__UpperCamelCase		:						int    ,			__UpperCamelCase		:						int			)      ->      int:
							"""simple docstring"""





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


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

				testmod()
				# Initialize compressor class
				_lowercase       :						int						=LZaaCompressor(window_size=13, lookahead_buffer_size=6)

				# Example
				_lowercase       :						List[Any]						="cabracadabrarrarrad"
				_lowercase       :						List[str]						=lzaa_compressor.compress(TEXT)
				print(lzaa_compressor.compress("ababcbababaa"))
				_lowercase       :						Tuple						=lzaa_compressor.decompress(compressed_text)
				assert decompressed_text == TEXT, "The LZ77 algorithm returned the invalid result."









'''simple docstring'''



def 							__UpperCAmelCase				(				UpperCamelCase__				:int			)		->						Any:
				snake_case__      :   Dict      =    len(UpperCamelCase__			)
				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)
																snake_case__      :   int      =    lst[j + 1]
																snake_case__      :   Tuple      =    lst[j]
																snake_case__      :   Tuple      =    temp
												if (
												    lst[no_of_elements - 1 - j] < lst[no_of_elements - 2 - j]
												):  # applying bubble sort algorithm from right to left (or backwards)
																snake_case__      :   Optional[Any]      =    lst[no_of_elements - 1 - j]
																snake_case__      :   Tuple      =    lst[no_of_elements - 2 - j]
																snake_case__      :   Any      =    temp
				return lst


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




