



"""simple docstring"""






from __future__ import annotations






def 			snake_case_    ( A_   :						list,							A_   :						int,							A_   :						int,							A_   :						int		):


       '''simple docstring'''





       _lowerCamelCase		:							Tuple            =					[]
       _lowerCamelCase     ,       _lowerCamelCase		:							str            =					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		:							Tuple            =					result + left + right
       return input_list






def 			snake_case_    ( A_   :						list		):


       '''simple docstring'''





       if len(A_		) <= 1:
              return input_list
       _lowerCamelCase		:							List[str]            =					list(A_		)

       # iteration for two-way merging
       _lowerCamelCase		:							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_		):
                     _lowerCamelCase		:							Union[str, Any]            =					i
                     _lowerCamelCase		:							Any            =					i + p - 1
                     _lowerCamelCase		:							str            =					(low + high + 1) // 2
                     _lowerCamelCase		:							List[str]            =					merge(A_,							A_,							A_,							A_		)
              # final merge of last two parts
              if p * 2 >= len(A_		):
                     _lowerCamelCase		:							Dict            =					i
                     _lowerCamelCase		:							Optional[int]            =					merge(A_,							0,							A_,							len(A_		) - 1		)
                     break
              p *= 2

       return input_list


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










"""simple docstring"""







def      UpperCamelCase       ( _A  ,				_A )     ->       None:
				lowercase    :      List[Any]       = len(_A )
				print("""The following activities are selected:""" )

				# The first activity is always selected
				lowercase    :      Optional[int]       = 0
				print(_A  ,				end=""",""" )

				# Consider rest of the activities
				for j in range(_A ):
								# If this activity has start time greater than
								# or equal to the finish time of previously
								# selected activity, then select it
								if start[j] >= finish[i]:
												print(_A  ,				end=""",""" )
												lowercase    :      str       = j


if __name__ == "__main__":
				import doctest

				doctest.testmod()

				_lowerCAmelCase            =	[1, 3, 0, 5, 8, 5]
				_lowerCAmelCase            =	[2, 4, 6, 7, 9, 9]
				print_max_activities(start, finish)
