



"""simple docstring"""






import argparse
from collections import defaultdict


def 			_lowercase				(  __snake_case					,__snake_case					,__snake_case					,__snake_case					,__snake_case	)						->   Dict:
			__lowerCAmelCase      :  Optional[int]												=       F"""{file}_{class_name}_{test_name}"""
			done_test[_id] += 1

			with open(__snake_case					,"r"	) as f:
						__lowerCAmelCase      :  List[Any]												=       f.readlines()

			__lowerCAmelCase      :  Any												=       F"""class {class_name}("""
			__lowerCAmelCase      :  Dict												=       F"""{4 * ' '}def {test_name}("""
			__lowerCAmelCase      :  Any												=       F"""{8 * ' '}{correct_line.split()[0]}"""
			__lowerCAmelCase      :  Dict												=       F"""{16 * ' '}{correct_line.split()[0]}"""
			__lowerCAmelCase      :  List[str]												=       False
			__lowerCAmelCase      :  Dict												=       False
			__lowerCAmelCase      :  Optional[int]												=       False
			__lowerCAmelCase      :  Tuple												=       False
			__lowerCAmelCase      :  List[Any]												=       0
			__lowerCAmelCase      :  Optional[int]												=       0

			__lowerCAmelCase      :  Any												=       []
			for line in lines:
						if line.startswith(__snake_case	):
									__lowerCAmelCase      :  Optional[Any]												=       True
						elif in_class and line.startswith(__snake_case	):
									__lowerCAmelCase      :  Optional[int]												=       True
						elif in_class and in_func and (line.startswith(__snake_case	) or line.startswith(__snake_case	)):
									__lowerCAmelCase      :  Any												=       len(line.split(correct_line.split()[0]	)[0]	)
									count += 1

									if count == done_test[_id]:
												__lowerCAmelCase      :  Tuple												=       True

						if in_class and in_func and in_line:
									if ")" not in line:
												continue
									else:
												__lowerCAmelCase      :  List[str]												=       True

						if in_class and in_func and in_line and insert_line:
									new_lines.append(F"""{spaces * ' '}{correct_line}"""	)
									__lowerCAmelCase      :  str												=       False
						else:
									new_lines.append(__snake_case	)

			with open(__snake_case					,"w"	) as f:
						for line in new_lines:
									f.write(__snake_case	)


def 			_lowercase				(  __snake_case					,__snake_case=None	)						->   Tuple:
			if fail is not None:
						with open(__snake_case					,"r"	) as f:
									__lowerCAmelCase      :  Union[str, Any]												=       {l.strip() for l in f.readlines()}
			else:
						__lowerCAmelCase      :  Union[str, Any]												=       None

			with open(__snake_case					,"r"	) as f:
						__lowerCAmelCase      :  List[str]												=       f.readlines()

			__lowerCAmelCase      :  str												=       defaultdict(__snake_case	)
			for line in correct_lines:
						__lowerCAmelCase						,	__lowerCAmelCase						,	__lowerCAmelCase						,	__lowerCAmelCase      :  Optional[Any]												=       line.split(";"	)
						if test_failures is None or "::".join([file, class_name, test_name]	) in test_failures:
									overwrite_file(__snake_case					,__snake_case					,__snake_case					,__snake_case					,__snake_case	)


if __name__ == "__main__":
	__snake_case							:   Tuple      =    argparse.ArgumentParser()
	parser.add_argument('--correct_filename', help='filename of tests with expected result')
	parser.add_argument('--fail_filename', help='filename of test failures', type=str, default=None)
	__snake_case							:   Optional[Any]      =    parser.parse_args()

	main(args.correct_filename, args.fail_filename)




"""simple docstring"""






from __future__ import annotations


def 			_lowercase				(  __snake_case					,__snake_case					,__snake_case					,__snake_case	)						->   list:
			__lowerCAmelCase      :  Dict												=       []
			__lowerCAmelCase						,	__lowerCAmelCase      :  Any												=       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	)	)
			__lowerCAmelCase      :  int												=       result + left + right
			return input_list


def 			_lowercase				(  __snake_case	)						->   list:
			if len(__snake_case	) <= 1:
						return input_list
			__lowerCAmelCase      :  int												=       list(__snake_case	)

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

			return input_list


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