


import decimal



def      _lowerCAmelCase  (							)->int:
   '''simple docstring'''






   snake_case_         =   0
   snake_case_         =   decimal.Context(prec=105							)
   for i in range(2						,  100							):
      snake_case_         =   decimal.Decimal(SCREAMING_SNAKE_CASE_							)
      snake_case_         =   number.sqrt(SCREAMING_SNAKE_CASE_							)
      if len(str(SCREAMING_SNAKE_CASE_							)							) > 1:
         answer += int(str(SCREAMING_SNAKE_CASE_							)[0]							)
         snake_case_         =   str(SCREAMING_SNAKE_CASE_							)[2:101]
         answer += sum(int(SCREAMING_SNAKE_CASE_							) for x in sqrt_number_str							)
   return answer


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   print(F'''{solution() = }''')








def      _lowerCAmelCase  (							lowerCAmelCase_							:Dict						,  lowerCAmelCase_							:Optional[int]						,  lowerCAmelCase_							:Tuple							)->Optional[Any]:
   '''simple docstring'''






   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

   snake_case_         =   bin_exp_mod(lowerCAmelCase_						,  n / 2						,  lowerCAmelCase_							)
   return (r * r) % b


if __name__ == "__main__":
   try:
      SCREAMING_SNAKE_CASE		:str											=       int(input('''Enter Base : ''').strip())
      SCREAMING_SNAKE_CASE		:List[Any]											=       int(input('''Enter Power : ''').strip())
      SCREAMING_SNAKE_CASE		:Dict											=       int(input('''Enter Modulo : ''').strip())
   except ValueError:
      print('''Invalid literal for integer''')

   print(bin_exp_mod(BASE, POWER, MODULO))




