#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define ld long double



int main()
{
   int t;
   cin>>t;


   while(t--)
   {

       int n;
       cin>>n;



       string s;
       cin>>s;


       vector < int > right_o(n+1,1);
       vector < int > right_a(n+1,1);


       for(int i=n-1;i>=0;--i)
       {
           //original
           if(s[i]=='R')
           {
               right_o[i]=1+right_a[i+1];
           }
           else
           {
               right_a[i]=1+right_o[i+1];
           }
       }


       vector < int > left_o(n+1,1);
       vector < int > left_a(n+1,1);

       for(int i=0;i<n;++i)
       {

           if(s[i]=='L')
           {
               left_o[i+1]=1+left_a[i];

           }
           else
               left_a[i+1]=1+left_o[i];
        }


        for(int i=0;i<=n;++i)
            cout<<left_o[i]+right_o[i]-1<<" ";

        cout<<endl;








   }









    return 0;
}
