#include<bits/stdc++.h>
using namespace std;
    // Creater: MrBB.TwinHTer - 2HT.
typedef long long ll;
typedef pair<int, int> ii;
typedef string str;
#define fi first
#define se second
#define pb push_back
#define pmod (int)1000000007
#define oo (ll)9223372036854775007
#define pd (ll)1000000007
const int base = 311;
const ll Hmod[] = {(int)1e9 + 2277, (int)1e9 + 5277, (int)1e9 + 8277, (int)1e9+ 9277};
const int gh = 998244353;

//==========================Pt==========================
void solve() {
	int n; cin >> n;
	str s; cin >> s;
	int a[n+10], city[n+10], city2[n+10];
	for(int i=0; i<n; i++) {
		if(s[i] == 'L') a[i+1] = 0;
		else a[i+1] = 1;
		city[i+1] = city2[i+1] = 1;
	}
	
	/*city[0] = 1;
	for(int i=1; i<=n; i+=2) {
		if(a[i] == 'R') {
			city[0]++;
			if(a[i+1] == 'L') city[0]++;
			else break;
		}
		else break;
	}
	cout << city[0] << " ";*/
	
	city[0] = city2[n+1] = 1; a[0] = 0; a[n+1] = 1;
	city2[0] = city[n+1] = 1;
	for(int i=1; i<=n; i++) {
		if(!a[i]) {
			if(!a[i-1]) city[i]++;
			else city[i]+=city[i-2]+1;
		} 
	}
	
	for(int i=n-1; i>=0; i--) {
		if(a[i+1]) {
			if(a[i+2]) city2[i]++;
			else city2[i]+=city2[i+2]+1;
		}
	}
	for(int i=0; i<=n; i++) cout << city[i]+city2[i]-1 << " ";
	cout << endl;
}
//==========================CT==========================
int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	int test_case;cin >> test_case; while(test_case--)
	   	solve();    
}