






from __future__ import annotations

from collections.abc import Iterator
from typing import Any






class 	lowercase_      :






      '''simple docstring'''




      def __init__(   self   :		Tuple				,      __UpperCAmelCase   :		Any						)					->None:




       """simple docstring"""


       a							=   data
       a							=   None







      def __str__(   self   :		Dict						)					->str:




       """simple docstring"""


       return F"""{self.data}"""






class 	lowercase_      :






      '''simple docstring'''




      def __init__(   self   :		Optional[int]						)					->None:




       """simple docstring"""


       a							=   None
       a							=   None







      def __iter__(   self   :		List[str]						)					->Iterator[Any]:




       """simple docstring"""


       a							=   self.front
       while node:
        yield node.data
        a							=   node.next







      def __len__(   self   :		List[Any]						)					->int:




       """simple docstring"""


       return len(tuple(iter(self						)						)						)







      def __str__(   self   :		List[Any]						)					->str:




       """simple docstring"""


       return " <- ".join(str(__UpperCAmelCase						) for item in self						)







      def    __lowerCAmelCase      (   self   :		Optional[Any]						)					->bool:




       """simple docstring"""


       return len(self						) == 0







      def    __lowerCAmelCase      (   self   :		Optional[int]				,      __UpperCAmelCase   :		Any						)					->None:




       """simple docstring"""


       a							=   Node(__UpperCAmelCase						)
       if self.is_empty():
        a							=   a							=   node
       else:
        assert isinstance(self.rear				,      __UpperCAmelCase						)
        a							=   node
        a							=   node







      def    __lowerCAmelCase      (   self   :		Optional[int]						)					->Any:




       """simple docstring"""


       if self.is_empty():
        raise IndexError('''dequeue from empty queue'''						)
       assert isinstance(self.front				,      __UpperCAmelCase						)
       a							=   self.front
       a							=   self.front.next
       if self.front is None:
        a							=   None
       return node.data







      def    __lowerCAmelCase      (   self   :		str						)					->None:




       """simple docstring"""


       a							=   a							=   None


if __name__ == "__main__":
     from doctest import testmod

     testmod()










def 		_a					(   a				:list				)							->    list:
 for i, _ in enumerate(a				):
  if (i % 2 == 1) == (nums[i - 1] > nums[i]):
   a						,  a							=   nums[i], nums[i - 1]

 return nums


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


