#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
#define endl '\n'
#define lowbit(x) (x & -x)
#define ls(x) (x << 1)
#define rs(x) (x << 1 | 1)
#define ck(x) (x >= mod ? x - mod : x)
#define inf 0x3f3f3f3f
#define eps 1e-6
#define maxn 300200
#define maxm 10000100
#define G 3
#define invG 332748118
const int mod = 1e9 + 7;
const double PI = 4 * atan2(1.0, 1.0);
int t, n, dis1[maxn], dis2[maxn], dis3[maxn], dis4[maxn];
char s1[maxn], s2[maxn];
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cin >> t;
    while (t--) {
        cin >> n;
        cin >> s1 + 1;
        for (int i = 1; i <= n; i++) {
            s2[i] = s1[i] == 'L' ? 'R' : 'L';
        }
        for (int i = 0; i <= n; i++) {
            dis1[i] = dis2[i] = dis3[i] = dis4[i] = 0;
        }
        dis1[0] = dis2[0] = 0;
        for (int i = 1; i <= n; i++) {
            if (s1[i] == 'L') dis1[i] = dis2[i - 1] + 1;
            if (s2[i] == 'L') dis2[i] = dis1[i - 1] + 1;
        }
        dis3[n] = dis4[n] = 0;
        for (int i = n; i >= 1; i--) {
            if (s1[i] == 'R') dis3[i - 1] = dis4[i] + 1;
            if (s2[i] == 'R') dis4[i - 1] = dis3[i] + 1;
        }
        for (int i = 0; i <= n; i++) {
            cout << dis1[i] + dis3[i] + 1 << ' ';
        }
        cout << endl;
    }
    return 0;
}