


'''simple docstring'''
from __future__ import annotations


def       a				(      __a			, __a			, __a			, __a       )  ->     list:



					'''simple docstring'''






					UpperCamelCase__       :List[Any]							 =			[]
					UpperCamelCase__       :Tuple							 =			input_list[low:mid], input_list[mid : high + 1]
					while left and right:
										result.append((left if left[0] <= right[0] else right).pop(0       )       )
					UpperCamelCase__       :int							 =			result + left + right
					return input_list


def       a				(      __a       )  ->     list:



					'''simple docstring'''






					if len(__a       ) <= 1:
										return input_list
					UpperCamelCase__       :Union[str, Any]							 =			list(__a       )

					# iteration for two-way merging
					UpperCamelCase__       :List[Any]							 =			2
					while p <= len(__a       ):
										# getting low, high and middle value for merge-sort of single list
										for i in range(0			, len(__a       )			, __a       ):
															UpperCamelCase__       :Dict							 =			i
															UpperCamelCase__       :Optional[int]							 =			i + p - 1
															UpperCamelCase__       :int							 =			(low + high + 1) // 2
															UpperCamelCase__       :Union[str, Any]							 =			merge(__a			, __a			, __a			, __a       )
										# final merge of last two parts
										if p * 2 >= len(__a       ):
															UpperCamelCase__       :List[Any]							 =			i
															UpperCamelCase__       :Any							 =			merge(__a			, 0			, __a			, len(__a       ) - 1       )
															break
										p *= 2

					return input_list


if __name__ == "__main__":
		__snake_case											=					input('''Enter numbers separated by a comma:\n''').strip()
		if user_input == "":
				__snake_case											=					[]
		else:
				__snake_case											=					[int(item.strip()) for item in user_input.split(''',''')]
		print(iter_merge_sort(unsorted))










'''simple docstring'''
from __future__ import annotations

from typing import Any


def       a				(      __a       )  ->     None:



					'''simple docstring'''






					create_state_space_tree(__a			, []			, 0       )


def       a				(      __a			, __a			, __a       )  ->     None:



					'''simple docstring'''






					if index == len(__a       ):
										print(__a       )
										return

					create_state_space_tree(__a			, __a			, index + 1       )
					current_subsequence.append(sequence[index]       )
					create_state_space_tree(__a			, __a			, index + 1       )
					current_subsequence.pop()


if __name__ == "__main__":
		__snake_case											=					[3, 1, 2, 4]
		generate_all_subsequences(seq)

		seq.clear()
		seq.extend(['''A''', '''B''', '''C'''])
		generate_all_subsequences(seq)