






UpperCAmelCase__            =	{
    "0": 1,
    "1": 1,
    "2": 2,
    "3": 6,
    "4": 24,
    "5": 120,
    "6": 720,
    "7": 5040,
    "8": 40320,
    "9": 362880,
}

UpperCAmelCase__            =	{145: 145}

UpperCAmelCase__            =	{
    145: 0,
    169: 3,
    36301: 3,
    1454: 3,
    871: 2,
    45361: 2,
    872: 2,
}
def 		_a					(   a				:int				)							->    int:
 if n in CACHE_SUM_DIGIT_FACTORIALS:
  return CACHE_SUM_DIGIT_FACTORIALS[n]
 a							=   sum(DIGIT_FACTORIALS[let] for let in str(a				)				)
 a							=   ret
 return ret
def 		_a					(   a				:int			,							a				:set | None = None				)							->    int:
 a							=   previous or set()
 if n in CHAIN_LENGTH_CACHE:
  return CHAIN_LENGTH_CACHE[n]
 a							=   sum_digit_factorials(a				)
 if next_number in previous:
  a							=   0
  return 0
 else:
  previous.add(a				)
  a							=   1 + chain_length(a			,							a				)
  a							=   ret
  return ret
def 		_a					(   a				:int = 60			,							a				:int = 1_000_000				)							->    int:
 return sum(1 for i in range(1			,							a				) if chain_length(a				) == num_terms				)


if __name__ == "__main__":
     print(f"""{solution() = }""")










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


