



"""simple docstring"""







import math
from itertools import permutations

def 							UpperCamelCase_       (       lowerCAmelCase__ :							int		)		->  bool:

  """simple docstring"""




  if 1 < number < 4:
    # 2 and 3 are primes
    return True
  elif number < 2 or number % 2 == 0 or number % 3 == 0:
    # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
    return False

  # All primes number are in format of 6k +/- 1
  for i in range(5       ,  int(math.sqrt(UpperCamelCase_		) + 1		)       ,  6		):
    if number % i == 0 or number % (i + 2) == 0:
      return False
  return True

def 							UpperCamelCase_       (       lowerCAmelCase__ :							int       ,  lowerCAmelCase__ :							list		)		->  bool:

  """simple docstring"""




  lowerCAmelCase_		,lowerCAmelCase_  :							List[Any]								=					0, len(UpperCamelCase_		) - 1
  while left <= right:
    lowerCAmelCase_  :							Optional[Any]								=					(left + right) // 2
    if prime_list[middle] == target:
      return True
    elif prime_list[middle] < target:
      lowerCAmelCase_  :							Union[str, Any]								=					middle + 1
    else:
      lowerCAmelCase_  :							int								=					middle - 1

  return False

def 							UpperCamelCase_       (       )		->  List[Any]:

  """simple docstring"""




  lowerCAmelCase_  :							str								=					[n for n in range(1001       ,  1_0000       ,  2		) if is_prime(UpperCamelCase_		)]
  lowerCAmelCase_  :							Dict								=					[]

  for number in prime_list:
    lowerCAmelCase_  :							Any								=					[]

    for prime_member in permutations(list(str(UpperCamelCase_		)		)		):
      lowerCAmelCase_  :							str								=					int(''.join(UpperCamelCase_		)		)

      if prime % 2 == 0:
        continue

      if search(UpperCamelCase_       ,  UpperCamelCase_		):
        tmp_numbers.append(UpperCamelCase_		)

    tmp_numbers.sort()
    if len(UpperCamelCase_		) >= 3:
      candidates.append(UpperCamelCase_		)

  lowerCAmelCase_  :							List[Any]								=					[]
  for candidate in candidates:
    lowerCAmelCase_  :							List[str]								=					len(UpperCamelCase_		)
    lowerCAmelCase_  :							Any								=					False

    for i in range(UpperCamelCase_		):
      for j in range(i + 1       ,  UpperCamelCase_		):
        for k in range(j + 1       ,  UpperCamelCase_		):
          if (
              abs(candidate[i] - candidate[j]		)
              == abs(candidate[j] - candidate[k]		)
              and len({candidate[i], candidate[j], candidate[k]}		) == 3
          ):
            passed.append(
                sorted([candidate[i], candidate[j], candidate[k]]		)		)
            lowerCAmelCase_  :							str								=					True

          if found:
            break
        if found:
          break
      if found:
        break

  lowerCAmelCase_  :							str								=					set()
  for seq in passed:
    answer.add(''.join([str(UpperCamelCase_		) for i in seq]		)		)

  return max(int(UpperCamelCase_		) for x in answer		)


if __name__ == "__main__":
     print(solution())








"""simple docstring"""





def     _A    (    UpperCamelCase_	:			list)      ->		list:
   '''simple docstring'''


   for i, _ in enumerate(UpperCamelCase_):
      if (i % 2 == 1) == (nums[i - 1] > nums[i]):
         __lowercase						,__lowercase								=		nums[i], nums[i - 1]

   return nums


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




