// 愚直 #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #define N_MAX 100000 #define u32 unsigned int #define MOD 998244353 int main(){ int n; scanf("%d", &n); char s[N_MAX]; scanf("%s", s); int a[N_MAX] = { 0 }; for(int i = 0; i < N_MAX; ++i){ if(s[i] == 'R'){ a[i] = 1; } } u32 dp0[N_MAX + 1] = { 0 }; u32 dp1[N_MAX + 1] = { 0 }; u32 ndp0[N_MAX + 1] = { 0 }; u32 ndp1[N_MAX + 1] = { 0 }; dp0[0] = dp1[0] = 1; if(a[0]){ dp1[1] = 1; } else{ dp0[1] = 1; } for(int i = 1; i < n; ++i){ // printf("%d\n", i); ndp0[0] = dp0[0]; ndp1[0] = dp1[0]; for(int j = 1; j < n + 1; ++j){ ndp0[j] = dp0[j]; ndp1[j] = dp1[j]; if(a[i]){ ndp1[j] += dp0[j - 1]; if(ndp1[j] >= MOD){ ndp1[j] -= MOD; } } else{ ndp0[j] += dp1[j - 1]; if(ndp0[j] >= MOD){ ndp0[j] -= MOD; } } } for(int j = 0; j < n + 1; ++j){ dp0[j] = ndp0[j]; dp1[j] = ndp1[j]; } } for(int j = 1; j < n + 1; ++j){ printf("%u\n", dp0[j] + dp1[j]); } return 0; }