#include <bits/stdc++.h>  
 
       
using namespace std;
#define nl '\n'
#define nt ' '
 
typedef   long long ll;
            
            
#define FIO ios_base::sync_with_stdio(0); cin.tie(0);  cout.tie(NULL);       
 
 
int md = 1e9 + 7 ; 

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b); 
     
}



int main(){
    
        FIO;
        int t;cin >> t; 
        while(t--){
                int n ;cin >> n ; 
                string s ; cin >>  s; 
                
                vector< vector<int> > df( 2 , vector<int>( n , 0 ) ) ; 
 
                char lc = s[0] ;
                int sk = 1; 
                for( int i =0 ; i<n; ++i ){
                        if( s[i]=='L' ){
                                df[0][i]+=1; 
                                if( i-1 >= 0 and lc == 'R' ) df[0][i] += sk ; 
                            }
                       
                        if( lc!=s[i] ) sk++;
                        else sk = 1;
                        lc = s[i] ; 
                    
                    }
                
                 lc = s[n-1] ;
                 sk = 1  ; 
                for( int i =n-1 ; i>=0; --i ){
                        if( s[i]=='R' ){
                                df[1][i]+=1; 
                                if( i+1 < n and lc == 'L' ) df[1][i] += sk ; 
                            }
                       
                        if( lc!=s[i] ) sk++;
                        else sk = 1;
                        lc = s[i] ; 
                    
                    }
             //   for( int i = 0 ; i<n ; ++i ) cout << df[1][i] << nt ;       
             //   cout << nl; 
//for( int i = 0 ; i<n ; ++i ) cout << df[0][i] << nt ;       
            //    cout << nl ; 
                for( int i=0 ; i<=n;  ++i ){
                        int rr = i, rl = i-1; 
                        int ta = 1;
                        if( rr>=0 and rr <n and s[rr]=='R' ) ta+= df[1][rr]; 
                        if( rl>=0 and rl <n and s[rl]=='L' ) ta+= df[0][rl]; 

                        cout << ta << nt ; 
                    }
                cout << nl; 
        }
}