#include using namespace std; long A,B,C; long power(long a,long b){return b?power(a*a%C,b/2)*(b%2?a:1)%C:1;} main() { cin>>A>>B>>C; long ans=0; for(int i=0;i=i))%C*power(i,B)%C; } cout<