#include <bits/stdc++.h>
using namespace std;

int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout.precision(10);
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		string s;
		cin >> s;
		int l[n + 1], r[n + 1];
		l[0] = 1;
		for (int i = 1; i <= n; i++) {
			l[i] = 1;
			if (i == 1) {
				if (s[i - 1] == 'L') {
					l[i] = 2;
				}
			} else {
				if (s[i - 1] == 'L') {
					l[i] = 2;
					if (s[i - 2] == 'R') {
						l[i] = 2 + l[i - 2];
					}
				}
			}
		}
		r[n] = 1;
		for (int i = n - 1; i >= 0; i--) {
			r[i] = 1;
			if (i == n - 1) {
				if (s[i] == 'R') {
					r[i] = 2;
				}
			} else {
				if (s[i] == 'R') {
					r[i] = 2;
					if (s[i + 1] == 'L') {
						r[i] = 2 + r[i + 2];
					}
				}
			}
		}
		for (int i = 0; i <= n; i++) {
			cout << l[i] + r[i] - 1 << ' ';
		}
		cout << endl;
	}
	return 0;
}