#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <random>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <string>
#include <list>
#include <ctime>
  
#define int long long
  
using namespace std;
using ll = long long;
using ld = long double;
const ll INT_INF = 1e9 + 1e7;
const ll INF = 4e18 + 1e17 + 7;
const ll MOD = 1e9 + 7;
const ld eps = (ld)1e-12;
const ld pi = acos(-1.0);

int n;
vector<bool> d;

void solve() {
    cin >> n;
    d.resize(n);
    for (int i=0; i<n; ++i) {
        char c;
        cin >> c;
        d[i] = (c=='L'?0:1);
    }
    vector<pair<int, int>> L(n+1, {0, 0}), R(n+1, {0, 0});
    for (int i = 1; i < n+1; ++i) {
        if (!d[i-1]) {
            L[i].first = L[i-1].second+1;
        }
        if (d[i-1]) {
            L[i].second = L[i-1].first+1;
        }
    }
    for (int i = n-1; i >= 0; --i) {
        if (d[i]) {
            R[i].first = R[i+1].second+1;
        }
        if (!d[i]) {
            R[i].second = R[i+1].first+1;
        }
    }
    for (int i = 0; i < n+1; ++i) {
        cout << L[i].first+R[i].first+1 << " ";
    }
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    #ifdef disastah
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    int t;
    cin >> t;
    for (int i = 0; i < t; ++i) {
        solve();
        cout << "\n";
    }
    #ifdef disastah
        cout.precision(7);
        cout << "\n";
        cout << "Time: " << 1.0 * clock() / CLOCKS_PER_SEC << "s  ";
    #endif
    return 0;
}