


class 			lowerCamelCase_		:





				"""simple docstring"""







				def __init__(						self       ,		UpperCAmelCase__       ,		UpperCAmelCase__       ,		UpperCAmelCase__     ):
								SCREAMING_SNAKE_CASE__     							=				name
								SCREAMING_SNAKE_CASE__     							=				value
								SCREAMING_SNAKE_CASE__     							=				weight



				def __repr__(						self     ):
								return f'''{self.__class__.__name__}({self.name}, {self.value}, {self.weight})'''



				def   lowerCAmelCase__		(						self     ):
								return self.value



				def   lowerCAmelCase__		(						self     ):
								return self.name



				def   lowerCAmelCase__		(						self     ):
								return self.weight






				def   lowerCAmelCase__		(						self     ):
								return self.value / self.weight


def __lowercase     (      lowerCamelCase_  :      Optional[Any]						,					lowerCamelCase_  :      List[str]						,					lowerCamelCase_  :      Union[str, Any]  ):
				SCREAMING_SNAKE_CASE__     							=				[]
				for i in range(len(lowerCamelCase_  )  ):
								menu.append(Things(name[i]						,					value[i]						,					weight[i]  )  )
				return menu


def __lowercase     (      lowerCamelCase_  :      Optional[int]						,					lowerCamelCase_  :      Union[str, Any]						,					lowerCamelCase_  :      Dict  ):
				SCREAMING_SNAKE_CASE__     							=				sorted(lowerCamelCase_						,					key=lowerCamelCase_						,					reverse=lowerCamelCase_  )
				SCREAMING_SNAKE_CASE__     							=				[]
				SCREAMING_SNAKE_CASE__     							=				0.0, 0.0
				for i in range(len(lowerCamelCase_  )  ):
								if (total_cost + items_copy[i].get_weight()) <= max_cost:
												result.append(items_copy[i]  )
												total_cost += items_copy[i].get_weight()
												total_value += items_copy[i].get_value()
				return (result, total_value)


def __lowercase     (      ):
				pass









if __name__ == "__main__":
	import doctest

	doctest.testmod()




"""simple docstring"""






from __future__ import annotations


def __lowercase     (      lowerCamelCase_  :      list						,					lowerCamelCase_  :      int						,					lowerCamelCase_  :      int						,					lowerCamelCase_  :      int  ):
				SCREAMING_SNAKE_CASE__     							=				[]
				SCREAMING_SNAKE_CASE__							,      SCREAMING_SNAKE_CASE__     							=				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  )  )
				SCREAMING_SNAKE_CASE__     							=				result + left + right
				return input_list


def __lowercase     (      lowerCamelCase_  :      list  ):
				if len(lowerCamelCase_  ) <= 1:
								return input_list
				SCREAMING_SNAKE_CASE__     							=				list(lowerCamelCase_  )

				# iteration for two-way merging
				SCREAMING_SNAKE_CASE__     							=				2
				while p <= len(lowerCamelCase_  ):
								# getting low, high and middle value for merge-sort of single list
								for i in range(0						,					len(lowerCamelCase_  )						,					lowerCamelCase_  ):
												SCREAMING_SNAKE_CASE__     							=				i
												SCREAMING_SNAKE_CASE__     							=				i + p - 1
												SCREAMING_SNAKE_CASE__     							=				(low + high + 1) // 2
												SCREAMING_SNAKE_CASE__     							=				merge(lowerCamelCase_						,					lowerCamelCase_						,					lowerCamelCase_						,					lowerCamelCase_  )
								# final merge of last two parts
								if p * 2 >= len(lowerCamelCase_  ):
												SCREAMING_SNAKE_CASE__     							=				i
												SCREAMING_SNAKE_CASE__     							=				merge(lowerCamelCase_						,					0						,					lowerCamelCase_						,					len(lowerCamelCase_  ) - 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))
