#include<bits/stdc++.h>
#define LL long long
LL power(LL a, LL b,LL p){
LL ans=0;
ans=1%p;
for(;b;b>>=1){
if(b&1) ans=(ans*a)%p;
a=(a*a)%p;
}
return ans;
}
using namespace std;
int main()
{
LL a,b,p;
cin>>a>>b>>p;
cout<<power(a,b,p);
return 0;
}
08-29
538
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-19
465
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-12
670
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)