#include<bits/stdc++.h>
#define int long long
#define PI pair<int,int>
using namespace std;
const int maxm=2e6+5;
char s[maxm];
int ans[maxm];
int n;
void solve(){
cin>>n;
cin>>(s+1);
int c=0,cc=0;
map<PI,int>mp;
for(int i=1;i<=n;i++){
if(s[i]=='D')c++;
else if(s[i]=='K')cc++;
int g=__gcd(c,cc);
mp[{c/g,cc/g}]++;
ans[i]=mp[{c/g,cc/g}];
}
for(int i=1;i<=n;i++){
cout<<ans[i]<<' ';
}
cout<<endl;
}
signed main(){
ios::sync_with_stdio(0);cin.tie(0);
int T;cin>>T;while(T--)
solve();
return 0;
}