
'''simple docstring'''







import math
from itertools import permutations
def       snake_case_	(       __SCREAMING_SNAKE_CASE      :				Optional[int]							):



						"""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       snake_case_	(       __SCREAMING_SNAKE_CASE      :				str   ,   __SCREAMING_SNAKE_CASE      :				Dict							):



						"""simple docstring"""





						lowercase_		,				lowercase_			:  Optional[int]									= 0, len(__SCREAMING_SNAKE_CASE							) - 1
						while left <= right:
												lowercase_			:  Optional[int]									= (left + right) // 2
												if prime_list[middle] == target:
																		return True
												elif prime_list[middle] < target:
																		lowercase_			:  Dict									= middle + 1
												else:
																		lowercase_			:  str									= middle - 1

						return False
def       snake_case_	(       ):



						"""simple docstring"""





						lowercase_			:  Any									= [n for n in range(1001   ,   10000   ,   2							) if is_prime(__SCREAMING_SNAKE_CASE							)]
						lowercase_			:  List[str]									= []

						for number in prime_list:
												lowercase_			:  List[str]									= []

												for prime_member in permutations(list(str(__SCREAMING_SNAKE_CASE							)							)							):
																		lowercase_			:  int									= 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							)

						lowercase_			:  List[str]									= []
						for candidate in candidates:
												lowercase_			:  Tuple									= len(__SCREAMING_SNAKE_CASE							)
												lowercase_			:  List[Any]									= 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]]							)							)
																																				lowercase_			:  List[Any]									= True

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

						lowercase_			:  Optional[int]									= 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())





'''simple docstring'''







import math
def       snake_case_	(       __SCREAMING_SNAKE_CASE      :				int							):



						"""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       snake_case_	(       __SCREAMING_SNAKE_CASE      :				int = 2000000							):



						"""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() = }""")



