#Q196. 「一本通 6.1 练习 1」A 的 B 次方

「一本通 6.1 练习 1」A 的 B 次方

Description

Given three integers a,b,ma, b, m, compute the value of abmodma^b \bmod m.

Input Format

One line containing three integers a,b,ma, b, m.

Output Format

A single integer representing the value of abmodma^b \bmod m.

Sample 1

2 100 1007

169

Constraints & Notes

For all test cases, 1a,b,m1091 \le a, b, m \le 10^9.