



from __future__ import annotations

from collections.abc import Generator


def       UpperCamelCase(  __UpperCamelCase							:		int			):
		if not isinstance(__UpperCamelCase					,__UpperCamelCase			) or n < 1:
				raise Exception('''Sequence only defined for positive integers'''			)

		yield n
		while n != 1:
				if n % 2 == 0:
						n //= 2
				else:
						lowerCAmelCase_      :					int     =			3 * n + 1
				yield n


def       UpperCamelCase(  ):
		lowerCAmelCase_      :					Dict     =			43
		lowerCAmelCase_      :					int     =			tuple(collatz_sequence(__UpperCamelCase			)			)
		print(__UpperCamelCase			)
		print(f"""Collatz sequence from {n} took {len(__UpperCamelCase			)} steps."""			)


if __name__ == "__main__":
						main()










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))





