#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int t;
int n;
const int maxn = 3e5+5;
string s;
int dr[maxn],d[maxn],sum[maxn],rsum[maxn];
int ans[maxn];
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> t;
    while(t--){
        cin >> n;
        cin >> s;
        for(int i = 1;i <= n;++i)
            if(s[i-1] == 'L')dr[i] = 0;
            else dr[i] = 1;
        for(int i = 0;i <= n;++i){
            d[i] = 0;
            if(i + 1 <= n){
                if(dr[i+1] != 0)d[i] = 1;
            }
            if(i > 0){
                if(dr[i] != 1){
                    if(d[i] == 1)
                        d[i] = 2;
                    else d[i] = -1;
                }
            }
            if(d[i] == 0){
                ans[i] = 1;
            }
        }
        sum[0] = 0;
        sum[1] = 1;
        int now = dr[1];
        for(int i = 2;i <= n;++i){
            if(now == dr[i]){
                sum[i] = 1;
                continue;
            }
            sum[i] = sum[i-1] + 1;
            now ^= 1;
        }
        rsum[n] = 1;
        now = dr[n];
        for(int i = n-1;i >= 1;--i){
            if(now == dr[i]){
                rsum[i] = 1;
                continue;
            }
            rsum[i] = rsum[i+1] + 1;
            now ^= 1;
        }
        for(int i = 0;i <= n;++i){
            if(d[i] == 0){
                ans[i] = 1;
                continue;
            }
            else if(d[i] == 1){
                ans[i] = rsum[i+1] + 1;
            }
            else if(d[i] == -1){
                ans[i] = sum[i] + 1;
            }
            else{
                ans[i] = sum[i] + rsum[i+1]+1;
            }
        }
        cout << ans[0];
        for(int i = 1;i <= n;++i){
            cout << " " << ans[i];
        }
        cout << "\n";
    }
    return 0;
}