#include #include #include #include #include #include using namespace std; typedef long long LL; const int Max = 10010; const LL mod = 9973; int inv[Max]; char str[Max*10]; LL Dp[Max*10]; LL Inv(LL a,LL b) { LL ans = 1; while(b) { if(b%2) ans = (ans*a)%mod; a =(a*a)%mod; b>>=1; } return ans; } void Init() { for(int i = 1;i<=mod;i++) inv[i] = Inv(i,mod-2); } int main() { Init(); int n; int L,R; while(~scanf("%d",&n)) { getchar(); gets(str); int len = strlen(str); Dp[0] = 1; for(int i = 0;i