#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define F first
#define S second
#define pb push_back
#define P push
#define B break
#define C continue
#define R return
#define lb(a,x) (lower_bound(a.begin(),a.end(),x)-a.begin())
#define ub(a,x) (upper_bound(a.begin(),a.end(),x)-a.begin())
#define fast ios::sync_with_stdio(NULL); cin.tie(0); cout.tie(0);
ll t,n,l[300009],r[300009],x,ans;
char c;
string s;
int main(){
    fast
    cin>>t;
    while(t--){
        c='#';
        cin>>n>>s;
        for(int i=0;i<n;i++){
            if(c!=s[i] && c!='#')ans++;
            else ans=1;
            l[i]=ans;
            c=s[i];
        }
        c='#';
        ans=0;
        for(int i=n-1;i>=0;i--){
            if(c!=s[i] && c!='#')ans++;
            else ans=1;
            r[i]=ans;
            c=s[i];
        }
        for(int i=0;i<=n;i++){
            x=0;
            if(i==0){
                if(s[i]=='R')cout<<r[i]+1<<" ";
                else cout<<1<<" ";
            }
            else if(i==n){
                if(s[i-1]=='L')cout<<l[i-1]+1<<" ";
                else cout<<1<<" ";
            }
            else {
                if(s[i-1]=='L')x+=l[i-1];
                if(s[i]=='R')x+=r[i];
                cout<<x+1<<" ";
            }
        }
        cout<<endl;
    }
}
