LearnPy Hub
← Arena
EasyRating 1000

Big Power Mod

Print aᵇ mod m.

Input

One line: a b m (0 ≤ a, b ≤ 10¹⁸, 1 ≤ m ≤ 10⁹).

Output

The result.

Sample 1

Input
2 10 1000
Output
24

Sample 2

Input
3 0 7
Output
1
solution.py
Output appears here
Big Power Mod · Python Arena problem · LearnPy Hub