





'''simple docstring'''

from typing import List

import PIL
import torch
from PIL import Image

from ...configuration_utils import ConfigMixin
from ...models.modeling_utils import ModelMixin
from ...utils import PIL_INTERPOLATION


class 			SCREAMING_SNAKE_CASE__	(					lowerCamelCase__				,lowerCamelCase__						):







					"""simple docstring"""






					def __init__(					self    :	int						):







							"""simple docstring"""
							super().__init__()

							self.register_buffer("watermark_image"						,     torch.zeros((62, 62, 4)						)						)
							__UpperCAmelCase     :				Optional[Any]					   =			None






					def 						lowerCamelCase_					(					self    :	Union[str, Any]						,     UpperCAmelCase_    :	Union[str, Any]						,     UpperCAmelCase_    :	Optional[int]=None						):







							"""simple docstring"""
							# copied from https://github.com/deep-floyd/IF/blob/b77482e36ca2031cb94dbca1001fc1e6400bf4ab/deepfloyd_if/modules/base.py#L287

							__UpperCAmelCase     :				int					   =			images[0].height
							__UpperCAmelCase     :				Optional[Any]					   =			images[0].width

							__UpperCAmelCase     :				List[Any]					   =			sample_size or h

							__UpperCAmelCase     :				List[Any]					   =			min(h / sample_size						,     w / sample_size						)
							__UpperCAmelCase   ,       __UpperCAmelCase     :				List[str]					   =			(int(h / coef						), int(w / coef						)) if coef < 1 else (h, w)

							__UpperCAmelCase   ,       __UpperCAmelCase     :				str					   =			1_024**2, img_w * img_h
							__UpperCAmelCase     :				List[Any]					   =			(Sa / Sa) ** 0.5
							__UpperCAmelCase   ,       __UpperCAmelCase   ,       __UpperCAmelCase     :				Any					   =			int(K * 62						), img_w - int(14 * K						), img_h - int(14 * K						)

							if self.watermark_image_as_pil is None:
									__UpperCAmelCase     :				Optional[int]					   =			self.watermark_image.to(torch.uinta						).cpu().numpy()
									__UpperCAmelCase     :				Any					   =			Image.fromarray(_UpperCAmelCase						,     mode="RGBA"						)
									__UpperCAmelCase     :				Tuple					   =			watermark_image

							__UpperCAmelCase     :				str					   =			self.watermark_image_as_pil.resize(
							    (wm_size, wm_size)						,     PIL_INTERPOLATION["bicubic"]						,     reducing_gap=_UpperCAmelCase						)

							for pil_img in images:
									pil_img.paste(_UpperCAmelCase						,     box=(wm_x - wm_size, wm_y - wm_size, wm_x, wm_y)						,     mask=wm_img.split()[-1]						)

							return images








UpperCAmelCase			=    10**8






def        __lowerCAmelCase    (SCREAMING_SNAKE_CASE					)->  bool:




      """simple docstring"""

      if n % 10 == 0:
            return False
      snake_case_       =      str(SCREAMING_SNAKE_CASE					)
      return s == s[::-1]






def        __lowerCAmelCase    ()->  int:




      """simple docstring"""

      snake_case_       =      set()
      snake_case_       =      1
      snake_case_       =      5
      while sum_squares < LIMIT:
            snake_case_       =      first_square + 1
            while sum_squares < LIMIT:
                  if is_palindrome(SCREAMING_SNAKE_CASE					):
                        answer.add(SCREAMING_SNAKE_CASE					)
                  last_square += 1
                  sum_squares += last_square**2
            first_square += 1
            snake_case_       =      first_square**2 + (first_square + 1) ** 2

      return sum(SCREAMING_SNAKE_CASE					)


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