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

const int N = 3e5 + 10;
typedef long long ll;

char s[N];
int T, n, f[N], g[N];
int main()
{
    scanf("%d", &T);
    while (T--)
    {
        scanf("%d", &n);
        scanf("%s", s + 1);
        f[1] = 1;
        for (int i = 2; i <= n; i++)
            f[i] = (s[i] == s[i - 1]) ? 1 : f[i - 1] + 1;
        g[n] = 1;
        for (int i = n - 1; i >= 1; i--)
            g[i] = (s[i] == s[i + 1]) ? 1 : g[i + 1] + 1;

        for (int i = 1; i <= n + 1; i++)
        {
            int ans = 1;
            if (i - 1 >= 1 and s[i - 1] == 'L')
                ans += f[i - 1];
            if (i <= n and s[i] == 'R')
                ans += g[i];
            printf("%d%c", ans, " \n"[i == n + 1]);
        }
    }
}