
def  lowerCAmelCase__			(  SCREAMING_SNAKE_CASE_     )				->		Tuple:
			lowerCAmelCase__      ,				lowerCAmelCase__      :      Any         =		[], []
			while len(SCREAMING_SNAKE_CASE_     ) > 1:
						lowerCAmelCase__      ,				lowerCAmelCase__      :      Union[str, Any]         =		min(SCREAMING_SNAKE_CASE_     ), max(SCREAMING_SNAKE_CASE_     )
						start.append(SCREAMING_SNAKE_CASE_     )
						end.append(SCREAMING_SNAKE_CASE_     )
						collection.remove(SCREAMING_SNAKE_CASE_     )
						collection.remove(SCREAMING_SNAKE_CASE_     )
			end.reverse()
			return start + collection + end


if __name__ == "__main__":
					lowerCamelCase__          =		input("""Enter numbers separated by a comma:\n""").strip()
					lowerCamelCase__          =		[int(item) for item in user_input.split(""",""")]
					print(*merge_sort(unsorted), sep=""",""")

def  lowerCAmelCase__			(  SCREAMING_SNAKE_CASE_     )				->		list:

			if len(SCREAMING_SNAKE_CASE_     ) <= 1:
						return [tuple(SCREAMING_SNAKE_CASE_     )]

			lowerCAmelCase__      :      Optional[Any]         =		[]

			def generate(SCREAMING_SNAKE_CASE_       ,							SCREAMING_SNAKE_CASE_     ):
						if k == 1:
									res.append(tuple(arr[:]     )     )
									return

						generate(k - 1       ,							SCREAMING_SNAKE_CASE_     )

						for i in range(k - 1     ):
									if k % 2 == 0:  # k is even
												lowerCAmelCase__      ,				lowerCAmelCase__      :      str         =		arr[k - 1], arr[i]
									else:  # k is odd
												lowerCAmelCase__      ,				lowerCAmelCase__      :      Union[str, Any]         =		arr[k - 1], arr[0]
									generate(k - 1       ,							SCREAMING_SNAKE_CASE_     )

			generate(len(SCREAMING_SNAKE_CASE_     )       ,							SCREAMING_SNAKE_CASE_     )
			return res


if __name__ == "__main__":
					lowerCamelCase__          =		input("""Enter numbers separated by a comma:\n""").strip()
					lowerCamelCase__          =		[int(item) for item in user_input.split(""",""")]
					print(heaps(arr))