



import heapq as hq
import math
from collections.abc import Iterator






class 						__a :



	def __init__(						self							:    Dict				,	snake_case_							:    Optional[int])->							Tuple:
						__lowerCAmelCase	   =str(id_)
						__lowerCAmelCase	   =None
						__lowerCAmelCase	   =None
						__lowerCAmelCase	   =[]
						__lowerCAmelCase	   ={}  # {vertex:distance}



	def __lt__(						self							:    List[str]				,	snake_case_							:    int)->							Any:
						return self.key < other.key



	def __repr__(						self							:    Any)->							Optional[Any]:
						return self.id



	def 		UpperCamelCase							(						self							:    Optional[int]				,	snake_case_							:    Union[str, Any])->							List[str]:
						self.neighbors.append(snake_case_)



	def 		UpperCamelCase							(						self							:    int				,	snake_case_							:    Any				,	snake_case_							:    Union[str, Any])->							List[Any]:
						__lowerCAmelCase	   =weight






def 					__lowerCAmelCase		(  __lowerCamelCase	:    List[str]				,   __lowerCamelCase	:    Optional[int]				,   __lowerCamelCase	:    List[Any]				,   __lowerCamelCase	:    Any	)  ->						List[Any]:
					# add the neighbors:
					graph[a - 1].add_neighbor(graph[b - 1]	)
					graph[b - 1].add_neighbor(graph[a - 1]	)
					# add the edges:
					graph[a - 1].add_edge(graph[b - 1]				,   __lowerCamelCase	)
					graph[b - 1].add_edge(graph[a - 1]				,   __lowerCamelCase	)






def 					__lowerCAmelCase		(  __lowerCamelCase	:    list				,   __lowerCamelCase	:    Vertex	)  ->						list:
					__lowerCAmelCase	   =[]
					for u in graph:
										__lowerCAmelCase	   =math.inf
										__lowerCAmelCase	   =None
					__lowerCAmelCase	   =0
					__lowerCAmelCase	   =graph[:]
					while q:
										__lowerCAmelCase	   =min(__lowerCamelCase	)
										q.remove(__lowerCamelCase	)
										for v in u.neighbors:
															if (v in q) and (u.edges[v.id] < v.key):
																				__lowerCAmelCase	   =u
																				__lowerCAmelCase	   =u.edges[v.id]
					for i in range(1				,   len(__lowerCamelCase	)	):
										a.append((int(graph[i].id	) + 1, int(graph[i].pi.id	) + 1)	)
					return a






def 					__lowerCAmelCase		(  __lowerCamelCase	:    list				,   __lowerCamelCase	:    Vertex	)  ->						Iterator[tuple]:
					for u in graph:
										__lowerCAmelCase	   =math.inf
										__lowerCAmelCase	   =None
					__lowerCAmelCase	   =0

					__lowerCAmelCase	   =list(__lowerCamelCase	)
					hq.heapify(__lowerCamelCase	)

					while h:
										__lowerCAmelCase	   =hq.heappop(__lowerCamelCase	)
										for v in u.neighbors:
															if (v in h) and (u.edges[v.id] < v.key):
																				__lowerCAmelCase	   =u
																				__lowerCAmelCase	   =u.edges[v.id]
																				hq.heapify(__lowerCamelCase	)

					for i in range(1				,   len(__lowerCamelCase	)	):
										yield (int(graph[i].id	) + 1, int(graph[i].pi.id	) + 1)






def 					__lowerCAmelCase		(  )  ->						None:
					pass


if __name__ == "__main__":
				import doctest

				doctest.testmod()









def 					__lowerCAmelCase		(  __lowerCamelCase	:    list	)  ->						list:
					if len(__lowerCamelCase	) <= 1:
										return lst

					__lowerCAmelCase	   =1

					while i < len(__lowerCamelCase	):
										if lst[i - 1] <= lst[i]:
															i += 1
										else:
															__lowerCAmelCase   ,	__lowerCAmelCase	   =lst[i], lst[i - 1]
															i -= 1
															if i == 0:
																				__lowerCAmelCase	   =1

					return lst


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




