
"""simple docstring"""







import operator
def   __UpperCamelCase   (					SCREAMING_SNAKE_CASE							,    SCREAMING_SNAKE_CASE = False							,    SCREAMING_SNAKE_CASE = None )  ->     Dict:







							"""simple docstring"""


							__snake_case     			=       operator.lt if reverse else operator.gt
							__snake_case     			=       solution or []

							if not arr:
														return solution

							__snake_case     			=       [arr.pop(0 )]
							for i, item in enumerate(__UpperCamelCase ):
														if _operator(__UpperCamelCase							,    sublist[-1] ):
																					sublist.append(__UpperCamelCase )
																					arr.pop(__UpperCamelCase )

    #  merging sublist into solution list
							if not solution:
														solution.extend(__UpperCamelCase )
							else:
														while sublist:
																					__snake_case     			=       sublist.pop(0 )
																					for i, xx in enumerate(__UpperCamelCase ):
																												if not _operator(__UpperCamelCase							,    __UpperCamelCase ):
																																			solution.insert(__UpperCamelCase							,    __UpperCamelCase )
																																			break
																					else:
																												solution.append(__UpperCamelCase )

							strand_sort(__UpperCamelCase							,    __UpperCamelCase							,    __UpperCamelCase )
							return solution


if __name__ == "__main__":
		assert strand_sort([4, 3, 5, 1, 2]) == [1, 2, 3, 4, 5]
		assert strand_sort([4, 3, 5, 1, 2], reverse=True) == [5, 4, 3, 2, 1]




"""simple docstring"""







import baseaa
def   __UpperCamelCase   (					SCREAMING_SNAKE_CASE )  ->     bytes:







							"""simple docstring"""


							return baseaa.baaencode(string.encode("utf-8" ) )
def   __UpperCamelCase   (					SCREAMING_SNAKE_CASE )  ->     str:







							"""simple docstring"""


							return baseaa.baadecode(SCREAMING_SNAKE_CASE ).decode("utf-8" )


if __name__ == "__main__":
		_SCREAMING_SNAKE_CASE	       =      """Hello World!"""
		_SCREAMING_SNAKE_CASE	       =      baseaa_encode(test)
		print(encoded)

		_SCREAMING_SNAKE_CASE	       =      baseaa_decode(encoded)
		print(decoded)
