ull c[4][256]; ll@n; ull@m,@b,z=1; m%=b; rep(j,4){ c[j][0]=1; c[j][1]=j==0?m:c[j-1][255]*c[j-1][1]%b; rep(i,2,256){ c[j][i]=c[j][i-1]*c[j][1]%b; } } ull p=EulerPhi(b); rep(n){ ull@a; a=(a-1)%p+1; z=z*(c[3][a>>24]*c[2][a>>16&255]%b*c[1][a>>8&255]%b*c[0][a&255]%b+1)%b; } wt(z);