


from doctest import testmod
from math import sqrt



def      _lowerCAmelCase  (							lowerCAmelCase_							:str							)->list:
   '''simple docstring'''






   snake_case_         =   []
   if num < 1:
      return facs
   facs.append(1							)
   if num == 1:
      return facs
   facs.append(lowerCAmelCase_							)
   for i in range(2						,  int(sqrt(lowerCAmelCase_							)							) + 1							):
      if num % i == 0:  # If i is a factor of num
         facs.append(lowerCAmelCase_							)
         snake_case_         =   num // i  # num//i is the other factor of num
         if d != i:  # If d and i are distinct
            facs.append(lowerCAmelCase_							)  # we have found another factor
   facs.sort()
   return facs


if __name__ == "__main__":
   testmod(name='''factors_of_a_number''', verbose=True)








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))




