/// HDM
#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define pb push_back
#define ld long double
#define time cout << "\nTime: " << clock()/(double) 1000 << "s "
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define inp freopen(duckman".inp", "r", stdin);
#define out freopen(duckman".out", "w", stdout);
const ll oo = 4557430888798830399;

#define duckman "Journey"

const ll nmax = 3e5 + 5, mod = 1000000007;
using namespace std;

ll n, L[nmax], R[nmax];
string s;
void Solve() {
    cin >> n;
    cin >> s;
    s = ' ' + s + ' ';
    ++n;
    for (ll i = 0; i <= n + 1; ++i) {
        L[i] = R[i] = 0;
    }
    for (ll i = 2; i <= n; ++i) {
        if (s[i - 1] != s[i - 2]) {
            L[i] = L[i - 1] + 1;
        }
        else {
            L[i] = 1;
        }
    }
    for (ll i = n - 1; i >= 1; --i) {
        if (s[i] != s[i + 1]) {
            R[i] = R[i + 1] + 1;
        }
        else {
            R[i] = 1;
        }
    }
    for (ll i = 1; i <= n; ++i) {
        ll ans = 1;
        if (s[i - 1] == 'L') {
            ans += L[i];
        }
        if (s[i] == 'R') {
            ans += R[i];
        }
        cout << ans << " ";
    }
    cout << endl;
}

int main() {
    fast;


    ll t;
    cin >> t;
    for (ll i = 1; i <= t; ++i) {
        Solve();
    }

}
/*

*/
