

import math
from itertools import permutations



def    lowerCAmelCase__							(		SCREAMING_SNAKE_CASE_:							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(SCREAMING_SNAKE_CASE_ ) + 1 )		,    6 ):
								if number % i == 0 or number % (i + 2) == 0:
												return False
				return True



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




				'''simple docstring'''





				A__      ,			A__            =     0, len(SCREAMING_SNAKE_CASE_ ) - 1
				while left <= right:
								A__            =     (left + right) // 2
								if prime_list[middle] == target:
												return True
								elif prime_list[middle] < target:
												A__            =     middle + 1
								else:
												A__            =     middle - 1

				return False



def    lowerCAmelCase__							(		)     -> Optional[int]:




				'''simple docstring'''





				A__            =     [n for n in range(1_0_0_1		,    1_0_0_0_0		,    2 ) if is_prime(SCREAMING_SNAKE_CASE_ )]
				A__            =     []

				for number in prime_list:
								A__            =     []

								for prime_member in permutations(list(str(SCREAMING_SNAKE_CASE_ ) ) ):
												A__            =     int("".join(SCREAMING_SNAKE_CASE_ ) )

												if prime % 2 == 0:
																continue

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

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

				A__            =     []
				for candidate in candidates:
								A__            =     len(SCREAMING_SNAKE_CASE_ )
								A__            =     False

								for i in range(SCREAMING_SNAKE_CASE_ ):
												for j in range(i + 1		,    SCREAMING_SNAKE_CASE_ ):
																for k in range(j + 1		,    SCREAMING_SNAKE_CASE_ ):
																				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]] ) )
																								A__            =     True

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

				A__            =     set()
				for seq in passed:
								answer.add("".join([str(SCREAMING_SNAKE_CASE_ ) for i in seq] ) )

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


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




import math



def    lowerCAmelCase__							(		SCREAMING_SNAKE_CASE_:							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(SCREAMING_SNAKE_CASE_ ) + 1 )		,    6 ):
								if number % i == 0 or number % (i + 2) == 0:
												return False
				return True



def    lowerCAmelCase__							(		SCREAMING_SNAKE_CASE_:							int = 2_0_0_0_0_0_0 )     -> int:




				'''simple docstring'''





				return sum(num for num in range(3		,    SCREAMING_SNAKE_CASE_		,    2 ) if is_prime(SCREAMING_SNAKE_CASE_ ) ) + 2 if n > 2 else 0


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

