

'''simple docstring'''
from typing import Dict, List, Optional, Union

import numpy as np

from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
from ...image_transforms import center_crop, normalize, rescale, resize, to_channel_dimension_format
from ...image_utils import (
    IMAGENET_DEFAULT_MEAN,
    IMAGENET_DEFAULT_STD,
    ChannelDimension,
    ImageInput,
    PILImageResampling,
    get_image_size,
    make_list_of_images,
    to_numpy_array,
    valid_images,
)
from ...utils import TensorType, is_vision_available, logging


if is_vision_available():
					import PIL


_lowerCamelCase	 =			logging.get_logger(__name__)
class  _snake_case						(__SCREAMING_SNAKE_CASE):
			__A   :     Optional[Any]          =["pixel_values"]






			def __init__(   self       ,_snake_case = True       ,_snake_case = None       ,_snake_case = True       ,_snake_case = None       ,_snake_case = PILImageResampling.BICUBIC       ,_snake_case = True       ,_snake_case = 1 / 2_55       ,_snake_case = True       ,_snake_case = None       ,_snake_case = None       ,**_snake_case       ,):
				super().__init__(**_snake_case			)
				UpperCAmelCase_			:	List[Any]      =   crop_size if crop_size is not None else {"height": 2_56, "width": 2_56}
				UpperCAmelCase_			:	List[Any]      =   get_size_dict(_snake_case       ,param_name="crop_size"			)
				UpperCAmelCase_			:	Any      =   size if size is not None else {"height": 2_24, "width": 2_24}
				UpperCAmelCase_			:	str      =   get_size_dict(_snake_case			)

				UpperCAmelCase_			:	List[Any]      =   do_center_crop
				UpperCAmelCase_			:	List[str]      =   crop_size
				UpperCAmelCase_			:	Optional[Any]      =   do_resize
				UpperCAmelCase_			:	List[str]      =   size
				UpperCAmelCase_			:	List[str]      =   resample
				UpperCAmelCase_			:	str      =   do_rescale
				UpperCAmelCase_			:	Optional[int]      =   rescale_factor
				UpperCAmelCase_			:	int      =   do_normalize
				UpperCAmelCase_			:	Dict      =   image_mean if image_mean is not None else IMAGENET_DEFAULT_MEAN
				UpperCAmelCase_			:	Tuple      =   image_std if image_std is not None else IMAGENET_DEFAULT_STD






			def 						UpperCamelCase__				(   self       ,_snake_case       ,_snake_case       ,_snake_case = None       ,_snake_case = None       ,**_snake_case       ,):
				UpperCAmelCase_			:	List[Any]      =   self.size if size is None else size
				UpperCAmelCase_			:	Optional[Any]      =   get_size_dict(_snake_case			)
				UpperCAmelCase_			:	Any      =   get_size_dict(_snake_case       ,param_name="crop_size"			)

				UpperCAmelCase_ , UpperCAmelCase_			:	List[str]      =   get_image_size(_snake_case			)
				UpperCAmelCase_			:	Optional[int]      =   min(_snake_case       ,_snake_case			)
				UpperCAmelCase_			:	Dict      =   (size["height"] / crop_size["height"]) * min_dim
				UpperCAmelCase_			:	Dict      =   (size["width"] / crop_size["width"]) * min_dim
				return center_crop(_snake_case       ,size=(cropped_height, cropped_width)       ,data_format=_snake_case       ,**_snake_case			)






			def 						UpperCamelCase__				(   self       ,_snake_case       ,_snake_case       ,_snake_case = PIL.Image.BICUBIC       ,_snake_case = None       ,**_snake_case       ,):
				UpperCAmelCase_			:	Union[str, Any]      =   get_size_dict(_snake_case			)
				if "height" not in size or "width" not in size:
					raise ValueError(f'''The size dictionary must contain the keys \'height\' and \'width\'. Got {size.keys()}'''			)
				return resize(
				    _snake_case       ,size=(size["height"], size["width"])       ,resample=_snake_case       ,data_format=_snake_case       ,**_snake_case			)






			def 						UpperCamelCase__				(   self       ,_snake_case       ,_snake_case       ,_snake_case = None       ,**_snake_case       ,):
				return rescale(_snake_case       ,scale=_snake_case       ,data_format=_snake_case       ,**_snake_case			)






			def 						UpperCamelCase__				(   self       ,_snake_case       ,_snake_case       ,_snake_case       ,_snake_case = None       ,**_snake_case       ,):
				return normalize(_snake_case       ,mean=_snake_case       ,std=_snake_case       ,data_format=_snake_case       ,**_snake_case			)






			def 						UpperCamelCase__				(   self       ,_snake_case       ,_snake_case = None       ,_snake_case = None       ,_snake_case = None       ,_snake_case = None       ,_snake_case = None       ,_snake_case = None       ,_snake_case = None       ,_snake_case = None       ,_snake_case = None       ,_snake_case = None       ,_snake_case = None       ,_snake_case = ChannelDimension.FIRST       ,**_snake_case       ,):
				UpperCAmelCase_			:	List[str]      =   do_center_crop if do_center_crop is not None else self.do_center_crop
				UpperCAmelCase_			:	Optional[int]      =   crop_size if crop_size is not None else self.crop_size
				UpperCAmelCase_			:	int      =   get_size_dict(_snake_case       ,param_name="crop_size"			)
				UpperCAmelCase_			:	Tuple      =   do_resize if do_resize is not None else self.do_resize
				UpperCAmelCase_			:	Optional[Any]      =   size if size is not None else self.size
				UpperCAmelCase_			:	List[str]      =   get_size_dict(_snake_case			)
				UpperCAmelCase_			:	Optional[Any]      =   resample if resample is not None else self.resample
				UpperCAmelCase_			:	int      =   do_rescale if do_rescale is not None else self.do_rescale
				UpperCAmelCase_			:	str      =   rescale_factor if rescale_factor is not None else self.rescale_factor
				UpperCAmelCase_			:	int      =   do_normalize if do_normalize is not None else self.do_normalize
				UpperCAmelCase_			:	Optional[Any]      =   image_mean if image_mean is not None else self.image_mean
				UpperCAmelCase_			:	Optional[Any]      =   image_std if image_std is not None else self.image_std

				UpperCAmelCase_			:	Union[str, Any]      =   make_list_of_images(_snake_case			)

				if not valid_images(_snake_case			):
					raise ValueError(
					    "Invalid image type. Must be of type PIL.Image.Image, numpy.ndarray, "
					    "torch.Tensor, tf.Tensor or jax.ndarray."			)

				if do_center_crop and crop_size is None:
					raise ValueError("If `do_center_crop` is set to `True`, `crop_size` must be provided."			)

				if do_resize and size is None:
					raise ValueError("Size must be specified if do_resize is True."			)

				if do_rescale and rescale_factor is None:
					raise ValueError("Rescale factor must be specified if do_rescale is True."			)

				if do_normalize and (image_mean is None or image_std is None):
					raise ValueError("Image mean and image standard deviation must be specified if do_normalize is True."			)

				# All transformations expect numpy arrays.
				UpperCAmelCase_			:	Optional[int]      =   [to_numpy_array(_snake_case			) for image in images]

				if do_center_crop:
					UpperCAmelCase_			:	str      =   [self.center_crop(_snake_case       ,_snake_case       ,size=_snake_case			) for image in images]

				if do_resize:
					UpperCAmelCase_			:	Union[str, Any]      =   [self.resize(image=_snake_case       ,size=_snake_case       ,resample=_snake_case			) for image in images]

				if do_rescale:
					UpperCAmelCase_			:	Tuple      =   [self.rescale(image=_snake_case       ,scale=_snake_case			) for image in images]

				if do_normalize:
					UpperCAmelCase_			:	Optional[Any]      =   [self.normalize(image=_snake_case       ,mean=_snake_case       ,std=_snake_case			) for image in images]

				UpperCAmelCase_			:	Union[str, Any]      =   [to_channel_dimension_format(_snake_case       ,_snake_case			) for image in images]

				UpperCAmelCase_			:	int      =   {"pixel_values": images}
				return BatchFeature(data=_snake_case       ,tensor_type=_snake_case			)







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


def       a__    (  _SCREAMING_SNAKE_CASE					:    int							)			-> bool:


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


def       a__    (  _SCREAMING_SNAKE_CASE					:    int     ,							_SCREAMING_SNAKE_CASE					:    list							)			-> bool:


	"""simple docstring"""





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

	return False


def       a__    (  )			-> Tuple:


	"""simple docstring"""





	UpperCAmelCase_			:	Dict      =   [n for n in range(10_01     ,							1_00_00     ,							2							) if is_prime(_SCREAMING_SNAKE_CASE							)]
	UpperCAmelCase_			:	Optional[int]      =   []

	for number in prime_list:
		UpperCAmelCase_			:	Optional[Any]      =   []

		for prime_member in permutations(list(str(_SCREAMING_SNAKE_CASE							)							)							):
			UpperCAmelCase_			:	List[Any]      =   int("".join(_SCREAMING_SNAKE_CASE							)							)

			if prime % 2 == 0:
				continue

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

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

	UpperCAmelCase_			:	Tuple      =   []
	for candidate in candidates:
		UpperCAmelCase_			:	Union[str, Any]      =   len(_SCREAMING_SNAKE_CASE							)
		UpperCAmelCase_			:	Any      =   False

		for i in range(_SCREAMING_SNAKE_CASE							):
			for j in range(i + 1     ,							_SCREAMING_SNAKE_CASE							):
				for k in range(j + 1     ,							_SCREAMING_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]]							)							)
						UpperCAmelCase_			:	Optional[Any]      =   True

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

	UpperCAmelCase_			:	Any      =   set()
	for seq in passed:
		answer.add("".join([str(_SCREAMING_SNAKE_CASE							) for i in seq]							)							)

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


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




