#include <bits/stdc++.h>

using namespace std;
#define ll long long

const int N = 3e5 + 10;
int L[N], R[N];

void solve()
{
    int T;
    cin >> T;
    while(T--){
        int n;
        string str;
        cin >> n >> str;
      //  int len = str.length();
        for(int i = n - 1; i >= 0; --i) {
            if(i == n - 1) {
                R[n] = 1;
            } else {
                if(str[i] != str[i + 1]) R[i + 1] = R[i + 2] + 1;
                else R[i + 1] = 1;
            }
        }
        for(int i = 0; i < n; ++i) {
            if(i == 0) {
                L[0] = 1;
            } else {
                if(str[i] != str[i - 1]) L[i] = L[i - 1] + 1;
                else L[i] = 1;
            }
        }

        vector<int > ans;
        for(int i = 0; i <= n; ++i) {
            int tot = 1;
            if(i != 0) tot += (str[i - 1] == 'L') ? L[i - 1] : 0;
            if(i != n) tot += (str[i] == 'R') ? R[i + 1] : 0;
            ans.push_back(tot);
        }
        for(auto x : ans) cout << x << " ";
        cout << endl;
    }
}

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    solve();

    return 0;
}
