//Created by: Aditya Singh
//Bleed Blue
#include <bits/stdc++.h>

using namespace std;

// #pragma GCC optimize("O3")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
#define int long long int
#define ld long double
#define F first
#define S second
#define P pair<int,int>
#define unm map<int,int>
#define pb emplace_back
#define PI 3.1415926535897932384626433
#define inf 1e18

const int N = 300005;

vector<int> gr[2 * N];
string s;

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int t; cin >> t; while (t--)
    {
        int i, j, k, n, m, ans = 0, sum = 0;
        cin >> n >> s;
        for (i = 0; i <= 2 * n + 1; i++)
            gr[i].clear();
        vector<int> comp(2 * n + 2, -1), cnt;
        for (i = 0; i < n; i++)
        {
            if (s[i] == 'L')
                gr[2 * (i + 1)].pb(2 * i + 1), gr[2 * i + 1].pb(2 * (i + 1));
            else
                gr[i * 2].pb(2 * (i + 1) + 1), gr[2 * (i + 1) + 1].pb(i * 2);
        }
        for (i = 0; i < 2 * n + 2; i++)
        {
            if (comp[i] != -1)
                continue;
            int c = 1;
            m = cnt.size();
            queue<int> q;
            q.push(i);
            comp[i] = m;
            while (!q.empty())
            {
                int cur = q.front();
                q.pop();
                for (int x : gr[cur])
                {
                    if (comp[x] == -1)
                    {
                        c++;
                        comp[x] = m;
                        q.push(x);
                    }
                }
            }
            cnt.pb(c);
        }
        for (i = 0; i <= n; i++)
            cout << cnt[comp[i * 2]] << ' ';
        cout << '\n';
    }
    return 0;
}