






import math
from itertools import permutations


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


def __A   (				__lowerCAmelCase			,		__lowerCAmelCase     )->  bool:





						"""simple docstring"""



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

						return False


def __A   (				)->  str:





						"""simple docstring"""



						_UpperCAmelCase     =      [n for n in range(1_001			,		10_000			,		2     ) if is_prime(__lowerCAmelCase     )]
						_UpperCAmelCase     =      []

						for number in prime_list:
												_UpperCAmelCase     =      []

												for prime_member in permutations(list(str(__lowerCAmelCase     )     )     ):
																		_UpperCAmelCase     =      int(''.join(__lowerCAmelCase     )     )

																		if prime % 2 == 0:
																								continue

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

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

						_UpperCAmelCase     =      []
						for candidate in candidates:
												_UpperCAmelCase     =      len(__lowerCAmelCase     )
												_UpperCAmelCase     =      False

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

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

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

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


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








from ..utils import DummyObject, requires_backends





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )





class __lowerCamelCase			(				metaclass=snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				["tokenizers"]

	def __init__(							self	,   *UpperCAmelCase	,   **UpperCAmelCase   ):
							"""simple docstring"""







							requires_backends(self	,   ['tokenizers']   )
