"""simple docstring"""






import math
from itertools import permutations



def   a_						( lowerCamelCase	):

				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	):
				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_						( ):
				UpperCAmelCase__					=							[n for n in range(1_0_0_1 ,      1_0_0_0_0 ,      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())




"""simple docstring"""






from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfigWithPast
from ...utils import logging


lowerCAmelCase__  :  str											=     logging.get_logger(__name__)

lowerCAmelCase__  :  Union[str, Any]											=     {
    'uclanlp/plbart-base': 'https://huggingface.co/uclanlp/plbart-base/resolve/main/config.json',
    # See all PLBART models at https://huggingface.co/models?filter=plbart
}
class     snake_case	(			__UpperCAmelCase    ):




					"""simple docstring"""

					snake_case__       =			"plbart"
					snake_case__       =			["past_key_values"]
					snake_case__       =			{"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}







					def __init__(    self       :     str   ,lowerCamelCase__       :     List[Any]=50_005   ,lowerCamelCase__       :     Optional[Any]=1_024   ,lowerCamelCase__       :     List[str]=6   ,lowerCamelCase__       :     Tuple=3_072   ,lowerCamelCase__       :     Optional[int]=12   ,lowerCamelCase__       :     Optional[int]=6   ,lowerCamelCase__       :     Optional[int]=3_072   ,lowerCamelCase__       :     Any=12   ,lowerCamelCase__       :     str=0.0   ,lowerCamelCase__       :     str=0.0   ,lowerCamelCase__       :     Union[str, Any]=True   ,lowerCamelCase__       :     str=True   ,lowerCamelCase__       :     Optional[int]="gelu"   ,lowerCamelCase__       :     Optional[Any]=768   ,lowerCamelCase__       :     int=0.1   ,lowerCamelCase__       :     int=0.1   ,lowerCamelCase__       :     Union[str, Any]=0.0   ,lowerCamelCase__       :     List[str]=0.0_2   ,lowerCamelCase__       :     Optional[int]=0.0   ,lowerCamelCase__       :     Dict=True   ,lowerCamelCase__       :     List[Any]=1   ,lowerCamelCase__       :     List[str]=0   ,lowerCamelCase__       :     Any=2   ,lowerCamelCase__       :     Any=2   ,**lowerCamelCase__       :     Dict   ,):
									UpperCAmelCase__					=							vocab_size
									UpperCAmelCase__					=							max_position_embeddings
									UpperCAmelCase__					=							d_model
									UpperCAmelCase__					=							encoder_ffn_dim
									UpperCAmelCase__					=							encoder_layers
									UpperCAmelCase__					=							encoder_attention_heads
									UpperCAmelCase__					=							decoder_ffn_dim
									UpperCAmelCase__					=							decoder_layers
									UpperCAmelCase__					=							decoder_attention_heads
									UpperCAmelCase__					=							dropout
									UpperCAmelCase__					=							attention_dropout
									UpperCAmelCase__					=							activation_dropout
									UpperCAmelCase__					=							activation_function
									UpperCAmelCase__					=							init_std
									UpperCAmelCase__					=							encoder_layerdrop
									UpperCAmelCase__					=							decoder_layerdrop
									UpperCAmelCase__					=							classifier_dropout
									UpperCAmelCase__					=							use_cache
									UpperCAmelCase__					=							encoder_layers
									UpperCAmelCase__					=							scale_embedding  # scale factor will be sqrt(d_model) if True
									super().__init__(
									    pad_token_id=lowerCamelCase__   ,bos_token_id=lowerCamelCase__   ,eos_token_id=lowerCamelCase__   ,is_encoder_decoder=lowerCamelCase__   ,forced_eos_token_id=lowerCamelCase__   ,**lowerCamelCase__   ,)






class     snake_case	(			__UpperCAmelCase    ):




					"""simple docstring"""

					@property
					def 		__lowerCAmelCase						(    self       :     int      ):
									return OrderedDict(
									    [
									        ('input_ids', {0: 'batch', 1: 'sequence'}),
									        ('attention_mask', {0: 'batch', 1: 'sequence'}),
									    ]      )







					@property
					def 		__lowerCAmelCase						(    self       :     Any      ):
									if self.use_past:
													return OrderedDict(
													    [
													        ('last_hidden_state', {0: 'batch', 1: 'sequence'}),
													        ('past_keys', {0: 'batch', 2: 'sequence'}),
													        ('encoder_last_hidden_state', {0: 'batch', 1: 'sequence'}),
													    ]      )
									else:
													return OrderedDict(
													    [
													        ('last_hidden_state', {0: 'batch', 1: 'sequence'}),
													        ('encoder_last_hidden_state', {0: 'batch', 1: 'sequence'}),
													    ]      )



