


from __future__ import annotations




def        __lowercase						(      __SCREAMING_SNAKE_CASE				,  __SCREAMING_SNAKE_CASE				,  __SCREAMING_SNAKE_CASE				,  __SCREAMING_SNAKE_CASE		)				->					list:
     """simple docstring"""




     __a       =   []
     __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        __lowercase						(      __SCREAMING_SNAKE_CASE		)				->					list:
     """simple docstring"""




     if len(snake_case__		) <= 1:
          return input_list
     __a       =   list(snake_case__		)

     # iteration for two-way merging
     __a       =   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__		):
               __a       =   i
               __a       =   i + p - 1
               __a       =   (low + high + 1) // 2
               __a       =   merge(snake_case__				,  snake_case__				,  snake_case__				,  snake_case__		)
          # final merge of last two parts
          if p * 2 >= len(snake_case__		):
               __a       =   i
               __a       =   merge(snake_case__				,  0				,  snake_case__				,  len(snake_case__		) - 1		)
               break
          p *= 2

     return input_list


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










'''simple docstring'''







def        __lowercase						(      __SCREAMING_SNAKE_CASE				,  __SCREAMING_SNAKE_CASE		)				->					str:
     """simple docstring"""




     __a       =   """"""
     for word_or_phrase in separated:
          if not isinstance(__SCREAMING_SNAKE_CASE				,  __SCREAMING_SNAKE_CASE		):
               raise Exception("""join() accepts only strings to be joined"""		)
          joined += word_or_phrase + separator
     return joined.strip(__SCREAMING_SNAKE_CASE		)


if __name__ == "__main__":
 from doctest import testmod

 testmod()






