



from __future__ import annotations






class 						__a :



	def __init__(						self							:    List[str]				,	snake_case_							:    int)->							Optional[int]:
						__lowerCAmelCase	   =order

						# a_{0} ... a_{k}
						__lowerCAmelCase	   =[1.0] + [0.0] * order
						# b_{0} ... b_{k}
						__lowerCAmelCase	   =[1.0] + [0.0] * order

						# x[n-1] ... x[n-k]
						__lowerCAmelCase	   =[0.0] * self.order
						# y[n-1] ... y[n-k]
						__lowerCAmelCase	   =[0.0] * self.order



	def 		UpperCamelCase							(						self							:    Optional[Any]				,	snake_case_							:    list[float]				,	snake_case_							:    list[float])->							Any:
						if len(UpperCAmelCase__) < self.order:
											__lowerCAmelCase	   =[1.0, *a_coeffs]

						if len(UpperCAmelCase__) != self.order + 1:
											__lowerCAmelCase	   =(
											    F"""Expected a_coeffs to have {self.order + 1} elements """
											    F"""for {self.order}-order filter, got {len(UpperCAmelCase__)}"""
											)
											raise ValueError(UpperCAmelCase__)

						if len(UpperCAmelCase__) != self.order + 1:
											__lowerCAmelCase	   =(
											    F"""Expected b_coeffs to have {self.order + 1} elements """
											    F"""for {self.order}-order filter, got {len(UpperCAmelCase__)}"""
											)
											raise ValueError(UpperCAmelCase__)

						__lowerCAmelCase	   =a_coeffs
						__lowerCAmelCase	   =b_coeffs



	def 		UpperCamelCase							(						self							:    Any				,	snake_case_							:    float)->							str:
						__lowerCAmelCase	   =0.0

						# Start at index 1 and do index 0 at the end.
						for i in range(1				,	self.order + 1):
											result += (
											    self.b_coeffs[i] * self.input_history[i - 1]
											    - self.a_coeffs[i] * self.output_history[i - 1]
											)

						__lowerCAmelCase	   =(result + self.b_coeffs[0] * sample) / self.a_coeffs[0]

						__lowerCAmelCase	   =self.input_history[:-1]
						__lowerCAmelCase	   =self.output_history[:-1]

						__lowerCAmelCase	   =sample
						__lowerCAmelCase	   =result

						return result









def 					__lowerCAmelCase		(  __lowerCamelCase	:    list	)  ->						list:
					__lowerCAmelCase	   =False
					while is_sorted is False:  # Until all the indices are traversed keep looping
										__lowerCAmelCase	   =True
										for i in range(0				,   len(__lowerCamelCase	) - 1				,   2	):  # iterating over all even indices
															if input_list[i] > input_list[i + 1]:
																				__lowerCAmelCase   ,	__lowerCAmelCase	   =input_list[i + 1], input_list[i]
																				# swapping if elements not in order
																				__lowerCAmelCase	   =False

										for i in range(1				,   len(__lowerCamelCase	) - 1				,   2	):  # iterating over all odd indices
															if input_list[i] > input_list[i + 1]:
																				__lowerCAmelCase   ,	__lowerCAmelCase	   =input_list[i + 1], input_list[i]
																				# swapping if elements not in order
																				__lowerCAmelCase	   =False
					return input_list


if __name__ == "__main__":
				print('''Enter list to be sorted''')
				lowercase_	       =			[int(x) for x in input().split()]
				# inputing elements of the list in one line
				lowercase_	       =			odd_even_sort(input_list)
				print('''The sorted list is''')
				print(sorted_list)




