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

#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define mp make_pair
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define fr(i,a,n) for(lli i=a;i<(n);i++)
#define frj(j,a,n) for(lli j=a;j<(n);j++)
#define frx(i,a,n) for(lli i=a;i>=(n);i--)
#define frxj(j,a,n) for(lli j=a;j>=(n);j--)
#define lli long long int
#define ld long double
#define vecI vector<lli>
#define vecP vector<pair<lli,lli>>
#define plli pair<lli,lli>
#define out2(x, a) << x << a
#define out1(x) << x
#define br << "\n"
#define itr iterator
#define print(v) for(auto it = v.begin(); it != v.end(); it++) {cout << *it << " ";} cout << endl;
#define sz(a) ((lli) a.size())
#define shiftleft(a, b) ((lli) a << b)


template<typename T>
class DSU {
    public:
    T length;
    vector<T> par;
    DSU(T n): length(n) {
        // assign all nodes as -1. Negative par[i] denotes that it is parent of the set and its magnitude denote size of the set
        par.assign(length, -1);    
    }
    T getParent(T elem){
        T parent = elem;
        while(par[parent] >= 0){
            parent = par[parent];
        }
        // if(parent != elem){
        //     // To collapse the the size of chains
        //     // if parent of this element is other than itself update it
        //     par[elem] = parent;
        // }
        return parent;
    }
    
    void unionNodes(T a, T b){
        T parent_a = getParent(a);
        T parent_b = getParent(b);
        T size_par_a = getSetSize(a);
        T size_par_b = getSetSize(b);
        if(size_par_a >= size_par_b){
            par[parent_b] = parent_a; 
            par[parent_a] = - (size_par_a + size_par_b);
        } else {
            par[parent_a] = parent_b;
            par[parent_b] = - (size_par_a + size_par_b);
        }
    }
    
    T getSetSize(T elem){
        return abs(par[getParent(elem)]);
    }
};

void solve(){
    lli n;
    string s;
    cin >> n >> s;
    DSU<lli> dsu(2*n+2);
    // 0 ... n
    // n+1, ...., 2*n+1
    fr(i,0,n){
        if(s[i] == 'L'){
            // union nodes i+1 , i+n
            dsu.unionNodes(i+1, i+n+1);
        } else {
            dsu.unionNodes(i, i+1+n+1);
        }
    }
    
    fr(i,0,n+1){
        cout << dsu.getSetSize(i) << " ";
    } cout br;
    
}

int main() {
	fast;
	lli t;
	cin >> t;
	while(t--)
		solve();
	return 0;
}

