/*
 * date: 2021-02-02 00:43:24.830485095+05:30
*/

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

class DSU {
  vector<int> parent;
  vector<int> sze;
  int components = 0;
public:
  DSU(int n = -1) { if(n >= 0) init(n); }
  void init(int n) {
    parent.resize(n + 1);
    sze.assign(n + 1, 1);
    components = n;
    for(int i = 0; i < n + 1; i++) parent[i] = i;
  }
  int find_set(int x) { return x == parent[x] ? x : parent[x] = find_set(parent[x]); }
  bool union_set(int a, int b) {
    a = find_set(a);
    b = find_set(b);
    bool union_required = (a != b);
    if(union_required) {
      if(sze[a] < sze[b]) { swap(a, b); }
      parent[b] = a;
      sze[a] += sze[b];
      components--;
    }
    return union_required;
  }
  int dsz(int x) { return sze[find_set(x)]; }
  int parts() { return components; }
};

DSU *dsu;

int solve() {
  int n; cin >> n;
  string s; cin >> s;
  dsu->init(2*n + 1);
  for(int i = 0; i < n; i++) {
    if(s[i] == 'L') dsu->union_set(i + 1, i + n + 1);
    else dsu->union_set(i, i + n + 2);
  }
  for(int i = 0; i <= n; i++) cout << dsu->dsz(i) << " \n"[i == n];
  return 0;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int t; cin >> t;
  dsu = new DSU(0);
  while(t--) { solve(); }
  return 0;
}
