
import math
from itertools import permutations
def     UpperCAmelCase__							(       __magic_name__						:     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(__magic_name__  ) + 1  )							,  6  ):
										if number % i == 0 or number % (i + 2) == 0:
															return False
					return True
def     UpperCAmelCase__							(       __magic_name__						:     int							,  __magic_name__						:     list  ):


					'''simple docstring'''

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

					return False
def     UpperCAmelCase__							(       ):


					'''simple docstring'''

					lowerCAmelCase		:					Dict  	=     [n for n in range(10_01							,  1_00_00							,  2  ) if is_prime(__magic_name__  )]
					lowerCAmelCase		:					Any  	=     []

					for number in prime_list:
										lowerCAmelCase		:					List[Any]  	=     []

										for prime_member in permutations(list(str(__magic_name__  )  )  ):
															lowerCAmelCase		:					str  	=     int(''''''.join(__magic_name__  )  )

															if prime % 2 == 0:
																				continue

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

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

					lowerCAmelCase		:					List[Any]  	=     []
					for candidate in candidates:
										lowerCAmelCase		:					Dict  	=     len(__magic_name__  )
										lowerCAmelCase		:					Union[str, Any]  	=     False

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

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

					lowerCAmelCase		:					List[str]  	=     set()
					for seq in passed:
										answer.add(''''''.join([str(__magic_name__  ) for i in seq]  )  )

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


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


def     UpperCAmelCase__							(       __magic_name__						:     Tuple							,  __magic_name__						:     int							,  __magic_name__						:     Dict							,  __magic_name__						:     str  ):


					'''simple docstring'''

					if start == end:
										return start if lst[start] > item else start + 1
					if start > end:
										return start

					lowerCAmelCase		:					Optional[Any]  	=     (start + end) // 2
					if lst[mid] < item:
										return binary_search(__magic_name__							,  __magic_name__							,  mid + 1							,  __magic_name__  )
					elif lst[mid] > item:
										return binary_search(__magic_name__							,  __magic_name__							,  __magic_name__							,  mid - 1  )
					else:
										return mid
def     UpperCAmelCase__							(       __magic_name__						:     List[Any]  ):


					'''simple docstring'''

					lowerCAmelCase		:					Union[str, Any]  	=     len(__magic_name__  )

					for index in range(1							,  __magic_name__  ):
										lowerCAmelCase		:					Optional[int]  	=     lst[index]
										lowerCAmelCase		:					Dict  	=     binary_search(__magic_name__							,  __magic_name__							,  0							,  index - 1  )
										lowerCAmelCase		:					Union[str, Any]  	=     lst[:pos] + [value] + lst[pos:index] + lst[index + 1 :]

					return lst
def     UpperCAmelCase__							(       __magic_name__						:     Optional[int]							,  __magic_name__						:     List[str]  ):


					'''simple docstring'''

					if not left:
										return right

					if not right:
										return left

					if left[0] < right[0]:
										return [left[0], *merge(left[1:]							,  __magic_name__  )]

					return [right[0], *merge(__magic_name__							,  right[1:]  )]
def     UpperCAmelCase__							(       __magic_name__						:     str  ):


					'''simple docstring'''

					lowerCAmelCase		:					str  	=     len(__magic_name__  )
					lowerCAmelCase	,							lowerCAmelCase		:					Union[str, Any]  	=     [], []
					lowerCAmelCase		:					Union[str, Any]  	=     [lst[0]]
					lowerCAmelCase		:					Optional[Any]  	=     []
					lowerCAmelCase		:					List[Any]  	=     1
					while i < length:
										if lst[i] < lst[i - 1]:
															runs.append(__magic_name__  )
															lowerCAmelCase		:					Any  	=     [lst[i]]
										else:
															new_run.append(lst[i]  )
										i += 1
					runs.append(__magic_name__  )

					for run in runs:
										sorted_runs.append(insertion_sort(__magic_name__  )  )
					for run in sorted_runs:
										lowerCAmelCase		:					int  	=     merge(__magic_name__							,  __magic_name__  )

					return sorted_array
def     UpperCAmelCase__							(       ):


					'''simple docstring'''

					lowerCAmelCase		:					Tuple  	=     [5, 9, 10, 3, -4, 5, 1_78, 92, 46, -18, 0, 7]
					lowerCAmelCase		:					Optional[Any]  	=     tim_sort(__magic_name__  )
					print(__magic_name__  )


if __name__ == "__main__":
		main()
