


def      _lowerCAmelCase  (							lowerCAmelCase_							:str							)->Optional[Any]:
   '''simple docstring'''






   snake_case_         =   str(SCREAMING_SNAKE_CASE__							).strip()
   if not bin_string:
      raise ValueError("Empty string was passed to the function"							)
   snake_case_         =   bin_string[0] == '-'
   if is_negative:
      snake_case_         =   bin_string[1:]
   if not all(char in "01" for char in bin_string							):
      raise ValueError("Non-binary value was passed to the function"							)
   snake_case_         =   0
   for char in bin_string:
      snake_case_         =   2 * decimal_number + int(SCREAMING_SNAKE_CASE__							)
   return -decimal_number if is_negative else decimal_number


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

   testmod()








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




