﻿#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, n) for(int (i)=0; (i)<(n); (i)++)
#define FOR1(i, n) for(int (i)=1; (i)<=(n); (i)++)
#define FORI(i, n) for(int (i)=n-1; (i)>=0; (i)--)
template<class T, class U> void umin(T& x, const U& y){ x = min(x, (T)y);}
template<class T, class U> void umax(T& x, const U& y){ x = max(x, (T)y);}
template<class T, class U> void init(vector<T> &v, U x, size_t n) { v=vector<T>(n, (T)x); }
template<class T, class U, typename... W> void init(vector<T> &v, U x, size_t n, W... m) { v=vector<T>(n);  for(auto& a : v) init(a, x, m...); }

int n;
vector<int> p;
void dfs(int u0, int u, vector<vector<int>>& e,
        vector<vector<int>>& dp){

    dp[u][2] = u0;
    for(int v : e[u]){
        if (dp[v][2]){

        }
        else{
            p[v] = u;
            dfs(u0, v, e, dp);
        }
    }
}

int main(int argc, char** argv) {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout << setprecision(15);
    if (argc == 2 && atoi(argv[1]) == 123456789) freopen("d:\\code\\cpp\\contests\\stdin", "r", stdin);
    int T = 1;
    cin >> T;
    FOR1(t, T){
        cin >> n;
        string s[2];
        cin >> s[0];
        s[1] = s[0];
        FOR(i, n) s[0][i] = (s[0][i] == 'L' ? '0' : '1');
        FOR(i, n) s[1][i] = (s[0][i] == '0' ? '1' : '0');

        n++;
        p.clear();
        p.resize(2*n+1);
        vector<int> ind(2*n+1);
        vector<vector<int>> edges(2*n+1);
        vector<vector<int>> edgesb(2*n+1);

        //from t to 1-t
        FOR(t, 2) {
            FOR(i, n) {
                int u = t * n  + i + 1;
                if (i > 0 && s[t][i - 1] == '0') {
                    int v = i + n * (1-t);
                    edges[u].push_back(v);
                    edgesb[v].push_back(u);
                    ind[v]++;
                }
                if (i < n && s[t][i] == '1') {
                    int v = i + 2 + n * (1-t);
                    edges[u].push_back(v);
                    edgesb[v].push_back(u);
                    ind[v]++;
                }
            }
        }

        vector<vector<int>> dp;
        init(dp, 0, 2*n+1, 3);
        FOR(i, 2*n+1) FOR(t, 2) dp[i][t] = i - (i>n)*n;

        FOR1(u, n){
            if (!dp[u][2]){
                dfs(u, u, edges, dp);
            }
        }
        FOR1(u, 2*n){
            int u0 = dp[u][2];
            int v0 = u - (u>n)*n;
            umin(dp[u0][0], v0);
            umax(dp[u0][1], v0);
        }


        FOR1(u, n) {
            int u0 = dp[u][2];
            cout << dp[u0][1] - dp[u0][0] + 1 << " ";
        }
        cout << '\n';
    }
    if (argc == 2 && atoi(argv[1]) == 123456789) cout << clock()*1.0/CLOCKS_PER_SEC << " sec\n";
    return 0;
}

