Type: Default 1000ms 256MiB

A 的 B 次方

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

给出三个整数 a,b,m,求 abmodma^b mod m 的值。

Input Format

一行三个整数 a,b,m。

Output Format

一个整数,表示abmodm a^b mod m 的值。

2 100 1007
169

Hint

数据范围与提示:对于全部数据,1a,b,m109 1≤a,b,m≤10^9