"""simple docstring"""
from __future__ import annotations







def 		__a  (      _SCREAMING_SNAKE_CASE						,	_SCREAMING_SNAKE_CASE						,	_SCREAMING_SNAKE_CASE  )      ->int:
  assert n > 1 and a > 0 and greatest_common_divisor(_SCREAMING_SNAKE_CASE						,	_SCREAMING_SNAKE_CASE  ) == 1
  ((a__)				,       (a__)				,       (a__)):	int     				=      extended_gcd(_SCREAMING_SNAKE_CASE						,	_SCREAMING_SNAKE_CASE  )  # Implemented below
  a__:	int     				=      (b * s) % n
  return x







def 		__a  (      _SCREAMING_SNAKE_CASE						,	_SCREAMING_SNAKE_CASE  )      ->int:
  ((a__)				,       (a__)):	List[Any]     				=      extended_euclid(_SCREAMING_SNAKE_CASE						,	_SCREAMING_SNAKE_CASE  )  # Implemented below
  if b < 0:
    a__:	int     				=      (b % n + n) % n
  return b







def 		__a  (      _SCREAMING_SNAKE_CASE						,	_SCREAMING_SNAKE_CASE						,	_SCREAMING_SNAKE_CASE  )      ->int:
  a__:	str     				=      invert_modulo(_SCREAMING_SNAKE_CASE						,	_SCREAMING_SNAKE_CASE  )
  a__:	List[Any]     				=      (b * s) % n
  return x







def 		__a  (      _SCREAMING_SNAKE_CASE						,	_SCREAMING_SNAKE_CASE  )      ->tuple[int, int, int]:
  assert a >= 0 and b >= 0

  if b == 0:
    a__				,       a__				,       a__:	Optional[int]     				=      a, 1, 0
  else:
    ((a__)				,       (a__)				,       (a__)):	str     				=      extended_gcd(_SCREAMING_SNAKE_CASE						,	a % b  )
    a__:	Any     				=      q
    a__:	List[str]     				=      p - q * (a // b)

  assert a % d == 0 and b % d == 0
  assert d == a * x + b * y

  return (d, x, y)







def 		__a  (      _SCREAMING_SNAKE_CASE						,	_SCREAMING_SNAKE_CASE  )      ->tuple[int, int]:
  if b == 0:
    return (1, 0)
  ((a__)				,       (a__)):	List[Any]     				=      extended_euclid(_SCREAMING_SNAKE_CASE						,	a % b  )
  a__:	Optional[int]     				=      a // b
  return (y, x - k * y)







def 		__a  (      _SCREAMING_SNAKE_CASE						,	_SCREAMING_SNAKE_CASE  )      ->int:
  if a < b:
    a__				,       a__:	int     				=      b, a

  while a % b != 0:
    a__				,       a__:	Optional[Any]     				=      b, a % b

  return b


if __name__ == "__main__":
 from doctest import testmod

 testmod(name='modular_division', verbose=True)
 testmod(name='modular_division2', verbose=True)
 testmod(name='invert_modulo', verbose=True)
 testmod(name='extended_gcd', verbose=True)
 testmod(name='extended_euclid', verbose=True)
 testmod(name='greatest_common_divisor', verbose=True)



"""simple docstring"""
def 		__a  (      _SCREAMING_SNAKE_CASE = 100						,	_SCREAMING_SNAKE_CASE = 100  )      ->int:
  return max(
      sum(int(_SCREAMING_SNAKE_CASE  ) for x in str(base**power  )  )
      for base in range(_SCREAMING_SNAKE_CASE  )
      for power in range(_SCREAMING_SNAKE_CASE  )  )


# Tests
if __name__ == "__main__":
 import doctest

 doctest.testmod()


