





import os

import numpy
import onnx







def   __lowerCamelCase   (				__a  :int       ,	__a  :Optional[int]       )						->							List[str]:






		"""simple docstring"""

		A__     =  a.name
		A__     =  b.name

		A__     =  """"""
		A__     =  """"""

		A__     =  a == b

		A__     =  name_a
		A__     =  name_b

		return res







def   __lowerCamelCase   (				__a  :int       ,	__a  :Any       ,	__a  :Any       )						->							List[Any]:






		"""simple docstring"""

		for i, input_name in enumerate(node_proto.input       ):
				if input_name == name:
						node_proto.input.insert(__a       ,	__a       )
						node_proto.input.pop(i + 1       )

		if node_proto.op_type == "If":
				_graph_replace_input_with(node_proto.attribute[0].g       ,	__a       ,	__a       )
				_graph_replace_input_with(node_proto.attribute[1].g       ,	__a       ,	__a       )
		if node_proto.op_type == "Loop":
				_graph_replace_input_with(node_proto.attribute[0].g       ,	__a       ,	__a       )







def   __lowerCamelCase   (				__a  :Optional[int]       ,	__a  :Tuple       ,	__a  :Optional[int]       )						->							Dict:






		"""simple docstring"""

		for n in graph_proto.node:
				_node_replace_input_with(__a       ,	__a       ,	__a       )







def   __lowerCamelCase   (				__a  :Optional[int]       ,	__a  :Optional[Any]       ,	__a  :str       )						->							List[str]:






		"""simple docstring"""

		A__     =  list(model.graph.initializer       )
		A__     =  list(model_without_ext.graph.initializer       )
		for i, ref_i in ind_to_replace:
				assert inits_with_data[i].name == inits[i].name
				assert inits_with_data[ref_i].name == inits[ref_i].name
				assert i > ref_i

				A__     =  inits[i].name
				A__     =  inits[ref_i].name

				model_without_ext.graph.initializer.remove(inits[i]       )

				# for n in model.graph.node:
				_graph_replace_input_with(model_without_ext.graph       ,	__a       ,	__a       )







def   __lowerCamelCase   (				__a  :int       )						->							Optional[Any]:






		"""simple docstring"""

		A__     =  os.path.dirname(__a       )
		A__     =  os.path.basename(__a       )

		A__     =  onnx.load(os.path.join(__a       ,	__a       )       )

		A__     =  list(model.graph.initializer       )

		A__     =  set()
		A__     =  {}
		A__     =  []

		A__     =  0

		for i in range(len(__a       )       ):
				if i in dup_set:
						continue

				for j in range(i + 1       ,	len(__a       )       ):
						if j in dup_set:
								continue
						if _is_equal_tensor_proto(inits[i]       ,	inits[j]       ):
								dup_set.add(__a       )
								dup_set.add(__a       )

								A__     =  inits[j].data_type
								A__     =  numpy.prod(inits[j].dims       )
								if dtype == 1:
										mem_size *= 4
								elif dtype == 6:
										mem_size *= 4
								elif dtype == 7 or dtype == 1_1:
										mem_size *= 8
								else:
										print("""unexpected data type: """       ,	__a       )
								total_reduced_size += mem_size

								A__     =  inits[i].name
								A__     =  inits[j].name

								if name_i in dup_map:
										dup_map[name_i].append(__a       )
								else:
										A__     =  [name_j]
								ind_to_replace.append((j, i)       )

		print("""total reduced size: """       ,	total_reduced_size / 1_0_2_4 / 1_0_2_4 / 1_0_2_4       ,	"""GB"""       )

		A__     =  sorted(__a       )
		_remove_dup_initializers_from_model(__a       ,	__a       ,	__a       )

		A__     =  """optimized_""" + model_file_name
		A__     =  os.path.join(__a       ,	__a       )
		onnx.save(__a       ,	__a       )

		return new_model










def   __lowerCamelCase   (				__a  :Optional[Any]       )						->							Tuple:






		"""simple docstring"""

		A__     =  len(__a       )
		while cur > 1:
				# Find the maximum number in arr
				A__     =  arr.index(max(arr[0:cur]       )       )
				# Reverse from 0 to mi
				A__     =  arr[mi::-1] + arr[mi + 1 : len(__a       )]
				# Reverse whole list
				A__     =  arr[cur - 1 :: -1] + arr[cur : len(__a       )]
				cur -= 1
		return arr


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



