


'''simple docstring'''
import math
from itertools import permutations




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




def      __snake_case       (       lowerCamelCase_ :				int	,  lowerCamelCase_ :				list						):
				'''simple docstring'''




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

				return False




def      __snake_case       (       ):
				'''simple docstring'''




				__magic_name__	  = [n for n in range(1001	,  1_0000	,  2						) if is_prime(lowerCamelCase_						)]
				__magic_name__	  = []

				for number in prime_list:
								__magic_name__	  = []

								for prime_member in permutations(list(str(lowerCamelCase_						)						)						):
												__magic_name__	  = 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_						)

				__magic_name__	  = []
				for candidate in candidates:
								__magic_name__	  = len(lowerCamelCase_						)
								__magic_name__	  = 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]]						)						)
																								__magic_name__	  = True

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

				__magic_name__	  = 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())







'''simple docstring'''
import os
import sys
import time

from . import transposition_cipher as trans_cipher




def      __snake_case       (       ):
				'''simple docstring'''




				__magic_name__	  = "Prehistoric Men.txt"
				__magic_name__	  = "Output.txt"
				__magic_name__	  = int(input("Enter key: "						)						)
				__magic_name__	  = input("Encrypt/Decrypt [e/d]: "						)

				if not os.path.exists(lowerCamelCase_						):
								print(F'File {input_file} does not exist. Quitting...'						)
								sys.exit()
				if os.path.exists(lowerCamelCase_						):
								print(F'Overwrite {output_file}? [y/n]'						)
								__magic_name__	  = input("> "						)
								if not response.lower().startswith("y"						):
												sys.exit()

				__magic_name__	  = time.time()
				if mode.lower().startswith("e"						):
								with open(lowerCamelCase_						) as f:
												__magic_name__	  = f.read()
								__magic_name__	  = trans_cipher.encrypt_message(lowerCamelCase_	,  lowerCamelCase_						)
				elif mode.lower().startswith("d"						):
								with open(lowerCamelCase_						) as f:
												__magic_name__	  = f.read()
								__magic_name__	  = trans_cipher.decrypt_message(lowerCamelCase_	,  lowerCamelCase_						)

				with open(lowerCamelCase_	,  "w"						) as output_obj:
								output_obj.write(lowerCamelCase_						)

				__magic_name__	  = round(time.time() - start_time	,  2						)
				print(("Done (", total_time, "seconds )")						)


if __name__ == "__main__":
						main()



