Exponentiation - 2
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
For given A, B and M to compute A^B mod M.
Input
In the input file are three natural numbers A, B and M (1 ≤ A
, B ≤ 10^18
, 2 ≤ M ≤ 2
*10^9
), записанные в одной строке через пробел.
Output
In the output file write a number equal to A^B mod M.
Examples
Input #1
Answer #1
Submissions 10K
Acceptance rate 30%