#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << endl; #define debug(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << x << endl; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } using namespace std; typedef long long ll; template vector> vec2d(int n, int m, T v){ return vector>(n, vector(m, v)); } template vector>> vec3d(int n, int m, int k, T v){ return vector>>(n, vector>(m, vector(k, v))); } template void print_vector(vector v, char delimiter=' '){ if(v.empty()) { cout << endl; return; } for(int i = 0; i+1 < v.size(); i++) cout << v[i] << delimiter; cout << v.back() << endl; } using mint = atcoder::modint998244353; ostream& operator<<(ostream& os, const mint& m){ os << m.val(); return os; } vector add(vector a, vector b){ if(a.size() << b.size()) swap(a, b); for(int i = 0; i < b.size(); i++) a[i] += b[i]; return a; } string s; // (B始まり, BRまり) pair, vector> solve(int l, int r){ if(r == l+1){ if(s[l] == 'B'){ return {{mint(1), mint(1)}, {mint(1), mint(0)}}; }else{ return {{mint(1), mint(0)}, {mint(1), mint(1)}}; } } int c = (l+r)/2; auto [lb, lr] = solve(l, c); auto [rb, rr] = solve(c, r); // cout << "==========" << endl; // print_vector(lb); // print_vector(lr); // print_vector(rb); // print_vector(rr); int ln = lb.size(); vector lbb(ln), lbr(ln), lrb(ln), lrr(ln); for(int i = 0; i < ln; i++){ if(i%2 == 1){ lbb[i] += lb[i]; lrr[i] += lr[i]; }else{ lbr[i] += lb[i]; lrb[i] += lr[i]; } } return {add(atcoder::convolution(lbb, rr), atcoder::convolution(lbr, rb)),add(atcoder::convolution(lrb, rr), atcoder::convolution(lrr, rb)) }; } int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; int n; cin >> n >> s; auto [b, r] = solve(0, n); for(int i = 1; i <= n; i++){ cout << b[i]+r[i] << "\n"; } }