



"""simple docstring"""







import math
from itertools import permutations

def 	lowerCAmelCase__      (  lowerCamelCase__      )			->				bool:

							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 	lowerCAmelCase__      (  lowerCamelCase__					,   lowerCamelCase__      )			->				bool:
							A   ,	A    =       0, len(lowerCamelCase__      ) - 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__      (  )			->				Any:
							A    =       [n for n in range(1001					,   10000					,   2      ) if is_prime(lowerCamelCase__      )]
							A    =       []

							for number in prime_list:
														A    =       []

														for prime_member in permutations(list(str(lowerCamelCase__      )      )      ):
																					A    =       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__      )

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

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

							A    =       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

from ...utils import logging
from .utils import DataProcessor, InputExample


A     =      logging.get_logger(__name__)






class   UpperCAmelCase__		(   UpperCamelCase  ):



		def __init__(			self	:     List[str]   ,				snake_case	:     List[Any]   ,				snake_case	:     str=None					)      ->    Tuple:






									'''simple docstring'''

									A    =       language
									A    =       train_language



		def        A_		(			self	:     Optional[int]   ,				snake_case	:     Any					)      ->    Union[str, Any]:






									'''simple docstring'''

									A    =       self.language if self.train_language is None else self.train_language
									A    =       self._read_tsv(os.path.join(snake_case   ,				f"""XNLI-MT-1.0/multinli/multinli.train.{lg}.tsv"""					)					)
									A    =       []
									for i, line in enumerate(snake_case					):
																if i == 0:
																							continue
																A    =       f"""train-{i}"""
																A    =       line[0]
																A    =       line[1]
																A    =       'contradiction' if line[2] == 'contradictory' else line[2]
																if not isinstance(snake_case   ,				snake_case					):
																							raise ValueError(f"""Training input {text_a} is not a string"""					)
																if not isinstance(snake_case   ,				snake_case					):
																							raise ValueError(f"""Training input {text_b} is not a string"""					)
																if not isinstance(snake_case   ,				snake_case					):
																							raise ValueError(f"""Training label {label} is not a string"""					)
																examples.append(InputExample(guid=snake_case   ,				text_a=snake_case   ,				text_b=snake_case   ,				label=snake_case					)					)
									return examples



		def        A_		(			self	:     int   ,				snake_case	:     int					)      ->    Optional[int]:






									'''simple docstring'''

									A    =       self._read_tsv(os.path.join(snake_case   ,				'XNLI-1.0/xnli.test.tsv'					)					)
									A    =       []
									for i, line in enumerate(snake_case					):
																if i == 0:
																							continue
																A    =       line[0]
																if language != self.language:
																							continue
																A    =       f"""test-{i}"""
																A    =       line[6]
																A    =       line[7]
																A    =       line[1]
																if not isinstance(snake_case   ,				snake_case					):
																							raise ValueError(f"""Training input {text_a} is not a string"""					)
																if not isinstance(snake_case   ,				snake_case					):
																							raise ValueError(f"""Training input {text_b} is not a string"""					)
																if not isinstance(snake_case   ,				snake_case					):
																							raise ValueError(f"""Training label {label} is not a string"""					)
																examples.append(InputExample(guid=snake_case   ,				text_a=snake_case   ,				text_b=snake_case   ,				label=snake_case					)					)
									return examples



		def        A_		(			self	:     Any					)      ->    List[Any]:






									'''simple docstring'''

									return ["contradiction", "entailment", "neutral"]



A     =      {
    'xnli': XnliProcessor,
}

A     =      {
    'xnli': 'classification',
}

A     =      {
    'xnli': 3,
}



