#include <bits/stdc++.h>
#define fast ios::sync_with_stdio(0), cin.tie(nullptr)
#define all(v) v.begin(), v.end()
#define x first
#define y second
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int S = 3 * 100005, MOD = (int)1e9 + 7;
const int mem_max = 0x3f;

ll dp[S][2][2]; // 0 = L / 1 = R
string load;
int n;
ll s(int v, int t, int from) {
	if (from == 2)
		return s(v, t, 0) + s(v, t, 1);
	if (dp[v][t][from] != -1)
		return dp[v][t][from];
	if (t) {
		if (from) {
			if (load[v - 1] == 'R')
				return dp[v][t][from] = s(v - 1, !t, from) + 1;
			else
				return dp[v][t][from] = 0;
		}
		else {
			if (load[v] == 'L')
				return dp[v][t][from] = s(v + 1, !t, from) + 1;
			else
				return dp[v][t][from] = 0;
		}
	}
	else {
		if (from) {
			if (load[v - 1] == 'L')
				return dp[v][t][from] = s(v - 1, !t, from) + 1;
			else
				return dp[v][t][from] = 0;
		}
		else {
			if (load[v] == 'R')
				return dp[v][t][from] = s(v + 1, !t, from) + 1;
			else
				return dp[v][t][from] = 0;
		}
	}
}
void solve() {
	cin >> n >> load;
	memset(dp, -1, sizeof(dp[0]) * (n + 2));
	dp[0][0][1] = dp[0][1][1] = 0;
	dp[n][0][0] = dp[n][1][0] = 0;
	for (int i = 0; i <= n; i++)
		cout << s(i, 0, 2) + 1 << ' ';
	cout << '\n';
}
int main() {
	fast;
	int t;
	cin >> t;
	while (t--)
		solve();
	return 0;
}