


"""simple docstring"""






from __future__ import annotations
def       A_   (   _lowerCAmelCase     :					list,     _lowerCAmelCase     :					int,     _lowerCAmelCase     :					int,     _lowerCAmelCase     :					int       ):






     """simple docstring"""

     _a    	=				[]
     _a    	=				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       )       )
     _a    	=				result + left + right
     return input_list
def       A_   (   _lowerCAmelCase     :					list       ):






     """simple docstring"""

     if len(a_       ) <= 1:
          return input_list
     _a    	=				list(a_       )

     # iteration for two-way merging
     _a    	=				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_       ):
               _a    	=				i
               _a    	=				i + p - 1
               _a    	=				(low + high + 1) // 2
               _a    	=				merge(a_,     a_,     a_,     a_       )
          # final merge of last two parts
          if p * 2 >= len(a_       ):
               _a    	=				i
               _a    	=				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 pathlib import Path

import fire
def       A_   (   _lowerCAmelCase     :					str,     _lowerCAmelCase     :					str,     _lowerCAmelCase     :					int       ):






     """simple docstring"""

     _a    	=				Path(_lowerCAmelCase       )
     _a    	=				Path(_lowerCAmelCase       )
     dest_dir.mkdir(exist_ok=_lowerCAmelCase       )
     for path in src_dir.iterdir():
          _a    	=				[x.rstrip() for x in list(path.open().readlines()       )][:n]
          _a    	=				dest_dir.joinpath(path.name       )
          print(_lowerCAmelCase       )
          dest_path.open('''w'''       ).write('''\n'''.join(_lowerCAmelCase       )       )


if __name__ == "__main__":
   fire.Fire(minify)