





def      SCREAMING_SNAKE_CASE      (   lowerCAmelCase     ,							lowerCAmelCase     ,							lowerCAmelCase       ):
       assert b != 0, "This cannot accept modulo that is == 0"
       if n == 0:
              return 1

       if n % 2 == 1:
              return (bin_exp_mod(lowerCAmelCase     ,							n - 1     ,							lowerCAmelCase       ) * a) % b

       _UpperCamelCase														=    bin_exp_mod(lowerCAmelCase     ,							n / 2     ,							lowerCAmelCase       )
       return (r * r) % b


if __name__ == "__main__":
       try:
              lowercase     :			Tuple     						=	int(input("""Enter Base : """).strip())
              lowercase     :			int     						=	int(input("""Enter Power : """).strip())
              lowercase     :			Union[str, Any]     						=	int(input("""Enter Modulo : """).strip())
       except ValueError:
              print("""Invalid literal for integer""")

       print(bin_exp_mod(BASE, POWER, MODULO))













import math
from decimal import Decimal, getcontext


def      SCREAMING_SNAKE_CASE      (   lowerCAmelCase = 4_000_000       ):

       try:
              _UpperCamelCase														=    int(lowerCAmelCase       )
       except (TypeError, ValueError):
              raise TypeError('''Parameter n must be int or castable to int.'''       )
       if n <= 0:
              raise ValueError('''Parameter n must be greater than or equal to one.'''       )
       _UpperCamelCase														=    100
       _UpperCamelCase														=    (Decimal(5       ) ** Decimal(0.5       ) + 1) / Decimal(2       )

       _UpperCamelCase														=    (math.floor(math.log(n * (phi + 2)     ,							lowerCAmelCase       ) - 1       ) // 3) * 3 + 2
       _UpperCamelCase														=    Decimal(round(phi ** Decimal(index + 1       )       )       ) / (phi + 2)
       _UpperCamelCase														=    num // 2
       return int(lowerCAmelCase       )


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






