#include <iostream>
#include <bits/stdc++.h>
#define ll long long
using namespace std;

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
     
}

int main() 
{
	ll t;
	cin >> t;
	while (t--) {
	    ll n;
	    cin >> n;
	    string s;
	    cin >> ws;
	    cin >> s;
	    map<pair<ll,ll>,ll>mp;
	    ll kc=0,dc=0;
	    for (ll i=0;i<n;i++) {
	        if (s[i]=='K')
	            kc++;
	        if (s[i]=='D')
	            dc++;
	        ll g = gcd(kc,dc);     
	        mp[{kc/g,dc/g}]++;
	        cout << mp[{kc/g,dc/g}] << " ";
	    }
	    cout << endl;
	}
	return 0;
}
