#n6b. a^b

a^b

Find the value of the modulus of pp to the power of bb of aa .

input format

Three integers aa , bb , pp , separated by spaces on the same line.

output format

Output an integer representing the value of a ^ b mod p.

data range

0a,b,p1090≤a,b,p≤10^9 Data Assurance p0p≠0

3 2 7
2

大概意思:

aabb 次方对 pp 取模的值。