#include<bits/stdc++.h>
#include <iterator>
#include <iostream>
#include <numeric>
#include <math.h>
#define ll long long
#define ull long
#define mpa make_pair
#define pb push_back
#define ff first
#define pii pair<ll,ll>
#define dd double
#define trace(x) cerr << #x << " : " << x << endl
#define ss second
#define boost ios_base::sync_with_stdio(0)
#define forp(i,a,b) for(ll i=a;i<=b;i++)
#define rep(i,n)    for(ll i=0;i<n;++i)
#define ren(i,n)    for(ll i=n-1;i>=0;i--)
#define forn(i,a,b) for(ll i=a;i>=b;i--)
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof((c).begin()) i = (c).begin(); i != (c).end();
#define sc(x) scanf("%lld",&x)
#define clr(x,val) memset(x,val,sizeof(x))
#define pr(x) printf("%lld\n",x) 
#define pdd pair<dd,dd>
#define read_arr(a,n) for(ll i=1;i<=n;i++)cin>>a[i];
#define init_arr(a,n) for(ll i=1;i<=n;i++)a[i]=n-i+1;
#define prec(x) cout<<fixed<<setprecision(x)
#define fre freopen("input.txt","r",stdin),freopen("output.txt","w",stdout)
#define arr array 
using namespace std;
ll par[1000005],sz[1000005];

ll find_par(ll v){
	if(par[v] == v) return v;
	return find_par(par[v]);
}
void clr_dsu(ll n){
	for(ll i=0;i<2*n+5;i++)sz[i]=1,par[i]=i;
}
void dsu(ll a,ll b){
	ll pa=find_par(a);
	ll pb=find_par(b);
	if(pa == pb) return;

	if(sz[pa]> sz[pb]){
		par[pb]=pa;
		sz[pa]+=sz[pb];
		sz[pb]=0;
	}else{
		par[pa]=pb;
		sz[pb]+=sz[pa];
		sz[pa]=0;
	}
}

int main(){
	ll t;
	cin>>t;
	while(t--){
		ll n;
		cin>>n;
		string s;
		cin>>s;
		clr_dsu(n);
		for(ll i=0;i<n;i++){
			if(s[i]=='L'){
				dsu(i+1,i+n+1);
			}else{
				dsu(i,i+n+2);
			}
		}

		for(ll i=0;i<n+1;i++)cout<<sz[find_par(i)]<<" ";
		cout<<endl;




	}
	





}


	
	

	
	




		


    
	


		