#define _USE_MATH_DEFINES
#define forn(i, n) for(lli i=0; i<n; i++)
#define forn1(i, n) for(lli i=1; i<n; i++)
#define fors(i, n) for(auto i = n.begin(); i != n.end(); i++)
#define forsr(i, n) for(auto i = n.rbegin(); i != n.rend(); i++)
#define debug(x) cerr << "------" << x << endl;
#define All(x) x.begin(), x.end()
#define remax(a, b) a = a > b ? a : b;
#define elif else if
#define lli long long int
#define _USE_MATH_DEFINES
#define _x first
#define _y second
#define iceil(a, b) a / b + (a % b > 0 ? 1 : 0)

#define _CRT_SECURE_NO_WARNINGS



//#include <bits/stdc++.h>

#include <stdlib.h>
#include <limits.h>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <cmath>
#include <numeric>
#include <map>
#include <unordered_map>
#include <vector>
#include <queue>
#include <set>
#include <unordered_set>
#include <bitset>
#include <stack>
#include <list>
#include <sstream>

#include <time.h>
#include <random>
#include <typeinfo>

using namespace std;

//Constant vars

const lli MOD = 1000000007, LIM = 4294967295;

//Vars

lli n, m, a, b, c, d, q, k, tr, summ, ans, minx, maxx, l, r, mid, l1, r1, mid1, res, mass[300005], mass1[300005], mass2[300005], mass3[300005];
string s, trs, str, ss;

//Structures

set<lli> g, bb, all;
set<lli> myset, myset1;
vector<lli> myvec1, toWrite, myvec2;
vector<vector<lli>> myvecvec;
map<lli, vector<pair<lli, lli>>> mm;
vector<lli> mvv, myvec;
map<lli, lli> mymap;

string YES = "YES", NO = "NO";

map<lli, vector<lli>> childs;
map<lli, set<lli>> mmap;


map<string, map<string, vector<string>>> familyWays;
map<string, map<string, lli>> familyStep, familyDoing, familyChidls;


int compare(const void * a, const void * b) {

	return -((*(lli*)a) - (*(lli*)b));

};

lli gcd(lli a, lli b) {

	while (b != 0) {

		lli t = b;
		b = a % b;
		a = t;

	}

	return a;

}

lli gcdex(lli a, lli b, lli & x, lli & y) {
	if (a == 0) {
		x = 0; y = 1;
		return b;
	}
	lli x1, y1;
	lli d = gcdex(b%a, a, x1, y1);
	x = y1 - (b / a) * x1;
	y = x1;
	return d;
}

lli NOK(lli n1, lli n2) {

	return n1 * n2 / gcd(n1, n2);

}

lli bin_pow(lli base, lli p) {
	if (p == 1) {
		return base % MOD;
	}
	if (p == 0) {
		return 1ll;
	}

	if (p % 2 == 0) {
		lli t = bin_pow(base, p / 2ll) % MOD;
		return t * t % MOD;
	}
	else {
		return bin_pow(base, p - 1ll) * base % MOD;
	}
}

lli inverse_element(lli x) {
	return bin_pow(x, MOD - 2ll);
}

lli divide(lli a, lli b) {
	return a * inverse_element(b) % MOD;
}


int check(int a, int b) {
	if (a == 0) {
		return 1;
	}
	if (a < 0) {
		return 0;
	}

	for (int i = b; i <= a / 10 + 1; i++) {
		if (check(a - b * 10 - m, i)) {
			return 1;
		}
	}

	return 0;
}


int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("testlist.txt", "w", stdout);

	ios::sync_with_stdio(0);
	cin.tie();
	cout.tie();

	cin >> q;

	while (q--) {

		cin >> n;

		cin >> s;
		s = s;
		mass[0] = 1;

		forn1(i, n) {
			if (s[i] != s[i - 1]) {
				mass[i] = mass[i - 1] + 1;
			}
			else {
				mass[i] = 1;
			}
		}

		forn(ii, n) {

			lli i = n - ii - 1;

			if (mass[i] > 1) {
				forn1(j, mass[i]) {
					mass[i - j] = mass[i];
				}
				ii += mass[i] - 1;
			}
		}


		forn(i, n - 1) {
			mass1[i] = 0;
			if (s[i] == 'R' && s[i + 1] == 'L') {
				mass1[i] = 1;
				continue;
			}
			if (s[i] == 'L') {
				mass1[i] = mass[i] + 1;
			}
			if (s[i + 1] == 'R') {
				mass1[i] = max(mass1[i], mass[i + 1] + 1);
			}
		}

		if (s[0] == 'R') {
			cout << mass[0] + 1;
		}
		else {
			cout << 1;
		}

		if (s[n - 1] == 'L') {
			mass1[n - 1] = mass[n - 1] + 1;
		}
		else {
			mass1[n - 1] = 1;
		}

		forn(i, n) {
			cout << ' ' << mass1[i];
		}

		cout << endl;

	}

	return 0;
}
//