#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define P 1000000007
#define inf 1e18
#define ld long double

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t, i, j;
    cin >> t;
    while (t--)
    {
        ll n;
        cin >> n;
        string s;
        cin >> s;
        //s = " " + s;
        vector<ll> ans(n + 2, 1);
        vector<ll> left(n + 2, 1), right(n + 2, 1);

        if (s[0] == 'L')
            left[0] = 1;
        for (i = 1; i < n; i++)
        {
            if (s[i] != s[i - 1])
                left[i] = left[i - 1] + 1;
        }

        if (s[n - 1] == 'R')
            right[n - 1] = 1;
        for (i = n - 2; i >= 0; i--)
        {
            if (s[i] != s[i + 1])
                right[i] = right[i + 1] + 1;
        }

        if (s[0] == 'R')
            ans[0] = ans[0] + right[0];
        if (s[n - 1] == 'L')
            ans[n] = ans[n] + left[n - 1];

        for (i = 1; i < n; i++)
        {
            if (s[i - 1] == 'L')
                ans[i] += left[i - 1];
            if (s[i] == 'R')
                ans[i] += right[i];
        }
        for (i = 0; i <= n; i++)
            cout << ans[i] << " ";
        cout << "\n";
    }

    return (0);
}
