#include #include using namespace std; int mod = 9973; int su[100100]; char text[100100]; int pow(int n, int p) { int ans=1; while(p) { if(p&1) ans=(ans*n)%mod; n=(n*n)%mod; p>>=1; } return ans; } int main() { int N, a, b, i, p, ans; while(scanf("%d",&N)!=EOF) { su[0] = 1; scanf("%s",text); for(i=0;text[i];i++) su[i+1] = (su[i] * (text[i]-28)) % mod; for(i=0;i