ull c[32]; ll@n; ull@m,@b,z=1; m%=b; c[0]=m; rep(i,31){ c[i+1]=c[i]*c[i]%b; } ull p=EulerPhi(b); rep(n){ ull@a; a=(a-1)%p+1; ull r=1; rep(i,32){ if(a&1){ r=r*c[i]%b; } a>>=1; } z=z*(r+1)%b; } wt(z);