﻿#include <iostream>
#include <vector>
#include <math.h>
#include <queue>
#include <string>
#include <numeric>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <map>
#include <stack>

using namespace std;

typedef long long ll;
typedef long double ld;


struct node {
    ll a;
    char c;
};

multiset<ll> s;
vector<bool> used;
vector<vector<node>> g;
vector<ll> a;
queue<ll> q;
vector<vector<ll>> dp;

bool comp(ll& n, ll& n1) {
    return n > n1;
}

int gcd(int n, int n1) {
    while (n != 0 && n1 != 0) {
        if (n > n1) n %= n1;
        else n1 %= n;
    }
    return n + n1;
}

const int CUTOFF = 300;

void solve() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int l = 0, r = 0;
    map<pair<int,int>, int> m;
    vector<int> a;
    for (int i = 0; i < s.length(); i++)
    {
        if (s[i] == 'D') l++;
        else r++;
        int g = gcd(l, r);
        a.push_back(++m[make_pair(l / g, r / g)]);
    }
    for (int i = 0; i < a.size(); i++)
    {
        cout << a[i] << " ";
    }
    cout << "\n";
}

int main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int tt;
    cin >> tt;
    //tt = 1;
    while (tt--) {
        solve();
    }
    return 0;
}