




import math


def 		_lowerCamelCase				(					UpperCamelCase							)			->		int:





  """simple docstring"""





  return sum(int(UpperCamelCase							) for digit in str(UpperCamelCase							)							)


def 		_lowerCamelCase				(					UpperCamelCase = 30							)			->		int:





  """simple docstring"""





  _lowercase: int						     =    []
  for digit in range(2					,     100							):
    for power in range(2					,     100							):
      _lowercase: int						     =    int(math.pow(UpperCamelCase					,     UpperCamelCase							)							)
      if digit == digit_sum(UpperCamelCase							):
        digit_to_powers.append(UpperCamelCase							)

  digit_to_powers.sort()
  return digit_to_powers[n - 1]


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






from cva import destroyAllWindows, imread, imshow, waitKey


def 		_lowerCamelCase				(					UpperCamelCase					,     UpperCamelCase							)			->		List[str]:





  """simple docstring"""





  _lowercase     ,					_lowercase: Tuple						     =    img.shape[0], img.shape[1]

  def to_grayscale(UpperCamelCase					,     UpperCamelCase					,     UpperCamelCase							):
    return 0.2_126 * red + 0.587 * green + 0.114 * blue

  def normalize(UpperCamelCase							):
    return min(UpperCamelCase					,     255							)

  for i in range(UpperCamelCase							):
    for j in range(UpperCamelCase							):
      _lowercase: Any						     =    int(to_grayscale(*img[i][j]							)							)
      _lowercase: str						     =    [
          normalize(UpperCamelCase							),
          normalize(greyscale + factor							),
          normalize(greyscale + 2 * factor							),
      ]

  return img


if __name__ == "__main__":
   # read original image
   UpperCAmelCase__						:       Optional[Any]							=    {
       percentage: imread('image_data/lena.jpg', 1) for percentage in (10, 20, 30, 40)
   }

   for percentage, img in images.items():
      make_sepia(img, percentage)

   for percentage, img in images.items():
      imshow(f'''Original image with sepia (factor: {percentage})''', img)

   waitKey(0)
   destroyAllWindows()
