
"""simple docstring"""

import math
from itertools import permutations
def 						UpperCAmelCase   (						a_     ):





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





		'''simple docstring'''


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

		return False
def 						UpperCAmelCase   (						):





		'''simple docstring'''


		lowerCamelCase	:     Tuple            =       [n for n in range(1001,		1_0000,		2     ) if is_prime(_snake_case     )]
		lowerCamelCase	:     List[str]            =       []

		for number in prime_list:
				lowerCamelCase	:     Union[str, Any]            =       []

				for prime_member in permutations(list(str(_snake_case     )     )     ):
						lowerCamelCase	:     int            =       int(''.join(_snake_case     )     )

						if prime % 2 == 0:
								continue

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

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

		lowerCamelCase	:     Optional[int]            =       []
		for candidate in candidates:
				lowerCamelCase	:     Any            =       len(_snake_case     )
				lowerCamelCase	:     str            =       False

				for i in range(_snake_case     ):
						for j in range(i + 1,		_snake_case     ):
								for k in range(j + 1,		_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]]     )     )
												lowerCamelCase	:     int            =       True

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

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

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


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












from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


UpperCAmelCase_    ={
    """configuration_bark""": [
        """BARK_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """BarkCoarseConfig""",
        """BarkConfig""",
        """BarkFineConfig""",
        """BarkSemanticConfig""",
    ],
    """processing_bark""": ["""BarkProcessor"""],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		UpperCAmelCase_    =[
		    """BARK_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """BarkFineModel""",
		    """BarkSemanticModel""",
		    """BarkCoarseModel""",
		    """BarkModel""",
		    """BarkPreTrainedModel""",
		    """BarkCausalModel""",
		]

if TYPE_CHECKING:
		from .configuration_bark import (
		    BARK_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    BarkCoarseConfig,
		    BarkConfig,
		    BarkFineConfig,
		    BarkSemanticConfig,
		)
		from .processing_bark import BarkProcessor

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_bark import (
				    BARK_PRETRAINED_MODEL_ARCHIVE_LIST,
				    BarkCausalModel,
				    BarkCoarseModel,
				    BarkFineModel,
				    BarkModel,
				    BarkPreTrainedModel,
				    BarkSemanticModel,
				)

else:
		import sys

		UpperCAmelCase_    =_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



