Module: Fast exponentiation


Problem

2 /5


Raising a to the power of b modulo c

Problem

Knowing a, b, c (non-negative integers, do not exceed \(2\cdot10^ 9\) ). Evaluate a to the power of b modulo c  (\(a^b mod \ c\)).

Input
The input is three non-negative integers separated by one space.

Imprint
Display the answer to the problem.

 

Examples
# Input Output
1 2 10 1000 24