#include <bits/stdc++.h>
using namespace std;
// #define int long long 
typedef pair<int, int> pii; 
#define ll long long
#define ar array
const int mxN=4e5;
const int mod=1e9+7;
const ll INF=1e18;
#define what_is(x) cerr << #x << " is " << x << endl;

vector<int> adj[2*mxN];
int parent[2*mxN];
vector<ar<int,2>>edges;
int sz[2*mxN];
int get_parent(int a){
	return parent[a]= parent[a]==a?a:get_parent(parent[a]);
}
void merge(int a, int b){
	a=get_parent(a);
	b=get_parent(b);

	if(a==b)return;
	sz[a]+=sz[b];
	parent[b]=a;
}
void solve(){
	int n;
	cin>>n;
	edges.clear();
	for(int i=1;i<=n;i++){
		char x; cin>>x;
		if(x=='L'){
			edges.push_back({i,i-1+mxN});
		
		}else{
			edges.push_back({i-1,mxN+i});
			
		}

	}
	for(int i=0;i<=n;i++){
		parent[i]=i;
		sz[i]=1;
		parent[i+mxN]=i+mxN;
		sz[i+mxN]=1;
	}
	
	for(auto e: edges){
			merge(e[0],e[1]);
		
	}

	for(int i=0;i<=n;i++){
		cout<<sz[get_parent(i)]<<" ";
	}
	cout<<endl;



}

signed main() {
	#ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        // freopen("output.txt","w",stdout);
    #endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout<<setprecision(12)<<fixed;
   
    int t=1;
    cin>>t;
    while(t--)
    	solve();
	return 0;
   
}  