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

#ifdef LOCAL 
string to_string(char a) { return string(1,a); }
string to_string(bool a) { return a ? "1" : "0"; }
string to_string(const char* a) { return (string)a; }
string to_string(string a) { return a; }
string to_string(vector<bool> v) {
	string s = "["; for(unsigned i=0;i<v.size();i++){ s += ((i>0)?" ":"");
    s += char('0'+v[i]); } 	s += "]"; return s; }
template<class A, class B> string to_string(pair<A,B> p);
template<class T> string to_string(T v) {
	bool b = 1; string s = "["; for (const auto& x: v) {
		if (!b) {s += ", ";} b = 0; s += to_string(x); } s += "]"; return s; }
template<class A, class B> string to_string(pair<A,B> p) {
	return "("+to_string(p.first)+", "+to_string(p.second)+")"; }
void dbgf() { cerr << endl; }
template<class H, class... T> void dbgf(H h, T... t) {
	cerr << to_string(h); if (sizeof...(t)) cerr << ", ";
	dbgf(t...); }
#define dbg(...) cerr << #__VA_ARGS__ << " = ", dbgf(__VA_ARGS__)
#else
#define dbg(...) 0
#endif
#define boolout(x) cout<<(x?"YES":"NO")<<endl;
typedef long long ll;


void solve()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    vector<int> l(n+1, 0);

    l[0] = 0;
    l[1] = (s[0]=='L')?1:0;
    for (int i = 1; i < n; i++ ){ 
        if (s[i]=='L' && s[i-1]=='R')
            l[i+1] = max(2, 2+l[i-1]);
        else if (s[i]=='L' && s[i-1]=='L')
            l[i+1] = 1;
        else l[i+1] = 0;
    }
    vector<int> r(n+1, 0);
    r[n] = 0;
    r[n-1] = (s[n-1]=='R')?1:0;
    for (int i = n-2; i >= 0; i--) {
        if (s[i]=='R' && s[i+1]=='L')
            r[i] = max(2, 2+r[i+2]);
        else if (s[i]=='R' && s[i+1]=='R')
            r[i] = 1;
        else r[i] = 0;
    }

    dbg(l);
    dbg(r);
    for (int i = 0; i <= n; i++) {
        cout << 1 + l[i] + r[i] << " ";
    } cout << endl;



    /* int start = 0; */
    /* for (int i = 0; i < n; i++ ){ */ 
    /*     char right = (i%2==0)?'R':'l'; */
    /*     if (s[i]==right) { */
    /*         r[start]++; */
    /*         r[i]=0; */
    /*     } else { */
    /*         start = i; */

    /*     } */

    /* } */
    /* for(char c: s) { */
    /*     if () */

    /* } */
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t; // read t. cin knows that t is an int, so it reads it as such.
    for (int i = 1; i <= t; ++i) {
        solve();
    }
    return 0;
}

