



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,
    convert_to_rgb,
    get_resize_output_image_size,
    normalize,
    rescale,
    resize,
    to_channel_dimension_format,
)
from ...image_utils import (
    OPENAI_CLIP_MEAN,
    OPENAI_CLIP_STD,
    ChannelDimension,
    ImageInput,
    PILImageResampling,
    make_list_of_images,
    to_numpy_array,
    valid_images,
)
from ...utils import TensorType, is_vision_available, logging


__UpperCAmelCase			  =			logging.get_logger(__name__)


if is_vision_available():
    import PIL



class 							lowerCAmelCase_						(    _snake_case				):
       UpperCAmelCase__							:   int  	=    ["pixel_values"]
       def __init__(     self,     SCREAMING_SNAKE_CASE_ = True,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = PILImageResampling.BICUBIC,     SCREAMING_SNAKE_CASE_ = True,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = True,     SCREAMING_SNAKE_CASE_ = 1 / 255,     SCREAMING_SNAKE_CASE_ = True,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = True,     **SCREAMING_SNAKE_CASE_,     )	->						str:
          super().__init__(**__lowerCamelCase			)
          UpperCamelCase       :    Optional[int]		      =      size if size is not None else {'''shortest_edge''': 224}
          UpperCamelCase       :    Optional[Any]		      =      get_size_dict(__lowerCamelCase,     default_to_square=__lowerCamelCase			)
          UpperCamelCase       :    List[str]		      =      crop_size if crop_size is not None else {'''height''': 224, '''width''': 224}
          UpperCamelCase       :    List[str]		      =      get_size_dict(__lowerCamelCase,     default_to_square=__lowerCamelCase,     param_name='crop_size'			)

          UpperCamelCase       :    Dict		      =      do_resize
          UpperCamelCase       :    Tuple		      =      size
          UpperCamelCase       :    List[Any]		      =      resample
          UpperCamelCase       :    Tuple		      =      do_center_crop
          UpperCamelCase       :    List[str]		      =      crop_size
          UpperCamelCase       :    Any		      =      do_rescale
          UpperCamelCase       :    List[Any]		      =      rescale_factor
          UpperCamelCase       :    Any		      =      do_normalize
          UpperCamelCase       :    Dict		      =      image_mean if image_mean is not None else OPENAI_CLIP_MEAN
          UpperCamelCase       :    str		      =      image_std if image_std is not None else OPENAI_CLIP_STD
          UpperCamelCase       :    Optional[int]		      =      do_convert_rgb
       def    snake_case_			(     self,     SCREAMING_SNAKE_CASE_,     SCREAMING_SNAKE_CASE_,     SCREAMING_SNAKE_CASE_ = PILImageResampling.BICUBIC,     SCREAMING_SNAKE_CASE_ = None,     **SCREAMING_SNAKE_CASE_,     )	->						Tuple:
          UpperCamelCase       :    Optional[int]		      =      get_size_dict(__lowerCamelCase,     default_to_square=__lowerCamelCase			)
          if "shortest_edge" not in size:
             raise ValueError(F"""The `size` parameter must contain the key `shortest_edge`. Got {size.keys()}"""			)
          UpperCamelCase       :    Optional[int]		      =      get_resize_output_image_size(__lowerCamelCase,     size=size['shortest_edge'],     default_to_square=__lowerCamelCase			)
          return resize(__lowerCamelCase,     size=__lowerCamelCase,     resample=__lowerCamelCase,     data_format=__lowerCamelCase,     **__lowerCamelCase			)
       def    snake_case_			(     self,     SCREAMING_SNAKE_CASE_,     SCREAMING_SNAKE_CASE_,     SCREAMING_SNAKE_CASE_ = None,     **SCREAMING_SNAKE_CASE_,     )	->						Any:
          UpperCamelCase       :    Optional[Any]		      =      get_size_dict(__lowerCamelCase			)
          if "height" not in size or "width" not in size:
             raise ValueError(F"""The `size` parameter must contain the keys (height, width). Got {size.keys()}"""			)
          return center_crop(__lowerCamelCase,     size=(size['height'], size['width']),     data_format=__lowerCamelCase,     **__lowerCamelCase			)
       def    snake_case_			(     self,     SCREAMING_SNAKE_CASE_,     SCREAMING_SNAKE_CASE_,     SCREAMING_SNAKE_CASE_ = None,     **SCREAMING_SNAKE_CASE_,     )	->						List[str]:
          return rescale(__lowerCamelCase,     scale=__lowerCamelCase,     data_format=__lowerCamelCase,     **__lowerCamelCase			)
       def    snake_case_			(     self,     SCREAMING_SNAKE_CASE_,     SCREAMING_SNAKE_CASE_,     SCREAMING_SNAKE_CASE_,     SCREAMING_SNAKE_CASE_ = None,     **SCREAMING_SNAKE_CASE_,     )	->						Tuple:
          return normalize(__lowerCamelCase,     mean=__lowerCamelCase,     std=__lowerCamelCase,     data_format=__lowerCamelCase,     **__lowerCamelCase			)






       def    snake_case_			(     self,     SCREAMING_SNAKE_CASE_,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = None,     SCREAMING_SNAKE_CASE_ = ChannelDimension.FIRST,     **SCREAMING_SNAKE_CASE_,     )	->						Dict:
          UpperCamelCase       :    List[Any]		      =      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(__lowerCamelCase,     param_name='size',     default_to_square=__lowerCamelCase			)
          UpperCamelCase       :    Union[str, Any]		      =      resample if resample is not None else self.resample
          UpperCamelCase       :    str		      =      do_center_crop if do_center_crop is not None else self.do_center_crop
          UpperCamelCase       :    Optional[Any]		      =      crop_size if crop_size is not None else self.crop_size
          UpperCamelCase       :    Optional[int]		      =      get_size_dict(__lowerCamelCase,     param_name='crop_size',     default_to_square=__lowerCamelCase			)
          UpperCamelCase       :    List[str]		      =      do_rescale if do_rescale is not None else self.do_rescale
          UpperCamelCase       :    Union[str, Any]		      =      rescale_factor if rescale_factor is not None else self.rescale_factor
          UpperCamelCase       :    Tuple		      =      do_normalize if do_normalize is not None else self.do_normalize
          UpperCamelCase       :    Any		      =      image_mean if image_mean is not None else self.image_mean
          UpperCamelCase       :    List[Any]		      =      image_std if image_std is not None else self.image_std
          UpperCamelCase       :    Tuple		      =      do_convert_rgb if do_convert_rgb is not None else self.do_convert_rgb

          UpperCamelCase       :    List[str]		      =      make_list_of_images(__lowerCamelCase			)

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

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

          if do_center_crop and crop_size is None:
             raise ValueError('Crop size must be specified if do_center_crop 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 std must be specified if do_normalize is True.'			)

          # PIL RGBA images are converted to RGB
          if do_convert_rgb:
             UpperCamelCase       :    List[str]		      =      [convert_to_rgb(__lowerCamelCase			) for image in images]

          # All transformations expect numpy arrays.
          UpperCamelCase       :    List[Any]		      =      [to_numpy_array(__lowerCamelCase			) for image in images]

          if do_resize:
             UpperCamelCase       :    List[str]		      =      [self.resize(image=__lowerCamelCase,     size=__lowerCamelCase,     resample=__lowerCamelCase			) for image in images]

          if do_center_crop:
             UpperCamelCase       :    int		      =      [self.center_crop(image=__lowerCamelCase,     size=__lowerCamelCase			) for image in images]

          if do_rescale:
             UpperCamelCase       :    int		      =      [self.rescale(image=__lowerCamelCase,     scale=__lowerCamelCase			) for image in images]

          if do_normalize:
             UpperCamelCase       :    List[str]		      =      [self.normalize(image=__lowerCamelCase,     mean=__lowerCamelCase,     std=__lowerCamelCase			) for image in images]

          UpperCamelCase       :    Any		      =      [to_channel_dimension_format(__lowerCamelCase,     __lowerCamelCase			) for image in images]

          UpperCamelCase       :    Optional[Any]		      =      {'''pixel_values''': images}
          return BatchFeature(data=__lowerCamelCase,     tensor_type=__lowerCamelCase			)







'''simple docstring'''





from functools import reduce

__lowerCamelCase												=						(
    '''73167176531330624919225119674426574742355349194934'''
    '''96983520312774506326239578318016984801869478851843'''
    '''85861560789112949495459501737958331952853208805511'''
    '''12540698747158523863050715693290963295227443043557'''
    '''66896648950445244523161731856403098711121722383113'''
    '''62229893423380308135336276614282806444486645238749'''
    '''30358907296290491560440772390713810515859307960866'''
    '''70172427121883998797908792274921901699720888093776'''
    '''65727333001053367881220235421809751254540594752243'''
    '''52584907711670556013604839586446706324415722155397'''
    '''53697817977846174064955149290862569321978468622482'''
    '''83972241375657056057490261407972968652414535100474'''
    '''82166370484403199890008895243450658541227588666881'''
    '''16427171479924442928230863465674813919123162824586'''
    '''17866458359124566529476545682848912883142607690042'''
    '''24219022671055626321111109370544217506941658960408'''
    '''07198403850962455444362981230987879927244284909188'''
    '''84580156166097919133875499200524063689912560717606'''
    '''05886116467109405077541002256983155200055935729725'''
    '''71636269561882670428252483600823257530420752963450'''
)


def        a__     (					UpperCamelCase_						:      str = N						):
   return max(
       # mypy cannot properly interpret reduce
       int(reduce(lambda UpperCamelCase_,   UpperCamelCase_						: str(int(UpperCamelCase_						) * int(UpperCamelCase_						)						),   n[i : i + 13]						)						)
       for i in range(len(UpperCamelCase_						) - 12						)						)


if __name__ == "__main__":
    print(F'''{solution() = }''')



