



from __future__ import annotations

A__  :  Union[str, Any]       = '''Alexander Joslin'''


def       UpperCamelCase(  __UpperCamelCase							:		int			):

		if number <= 0:
				lowerCAmelCase_      :					List[str]     =			f"""n must be greater than 0. Got n = {number}"""
				raise ValueError(__UpperCamelCase			)

		lowerCAmelCase_      :					List[str]     =			[number + 1] * (number + 1)

		# starting position
		lowerCAmelCase_      :					Any     =			0
		for i in range(1					,__UpperCamelCase			):
				lowerCAmelCase_      :					int     =			min(table[i + 1]					,table[i] + 1			)
				# check if out of bounds
				if i * 2 <= number:
						lowerCAmelCase_      :					Union[str, Any]     =			min(table[i * 2]					,table[i] + 1			)
				# check if out of bounds
				if i * 3 <= number:
						lowerCAmelCase_      :					Dict     =			min(table[i * 3]					,table[i] + 1			)
		return table[number]


if __name__ == "__main__":
						import doctest

						doctest.testmod()










def       UpperCamelCase(  __UpperCamelCase							:		list			):
		for i, _ in enumerate(__UpperCamelCase			):
				if (i % 2 == 1) == (nums[i - 1] > nums[i]):
						lowerCAmelCase_ ,  lowerCAmelCase_      :					Union[str, Any]     =			nums[i], nums[i - 1]

		return nums


if __name__ == "__main__":
						print('''Enter the array elements:''')
						A__  :  str       = list(map(int, input().split()))
						print('''The unsorted array is:''')
						print(array)
						print('''Array after Wiggle sort:''')
						print(wiggle_sort(array))





