eolymp
bolt
Try our new interface for solving problems
Problems

Exponentiation - 2

Exponentiation - 2

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 ≤ 1018, 2 ≤ M ≤ 2*109), записанные в одной строке через пробел.

Output

In the output file write a number equal to A^B mod M.

Time limit 1 second
Memory limit 64 MiB
Input example #1
2 100000000 1000
Output example #1
376