e-olymp
Competitions

Exponentiation

Modular Exponentiation

Find the value of expression xn mod m.

Input

Three positive integers x, n, m (1x, n109, 2m109).

Output

Print the value of xn mod m.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2 3 100
Output example #1
8