#include <bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=j;i<=n;i++)
#define repp(i,j,n) for(int i=n;i>=j;i--)
#define pb push_back
#define ll long long int
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pib pair<int,bool>
#define p_q priority_queue
#define inf 1000000005
# define fi first 
# define se second 
#define mod 1000000007

int main()
{
ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;cin>>t;
    while(t--){
        int n;
        cin>>n;
        string s;
        cin>>s;
        int dp[n];
        double rat[n];
        double d[n],k[n];
        if(s[0] == 'D'){d[0]=1;k[0]=0;}
        else{d[0]=0;k[0]=1;}
        if(k[0] == 0){rat[0]=-1;}
        else{rat[0]=0;}
        
        rep(i,1,n-1){
            if(s[i] == 'D'){d[i]=d[i-1]+1;k[i]=k[i-1];}
            else{k[i]=k[i-1]+1;d[i]=d[i-1];}
        if(k[i] == 0){
            rat[i]=-1;
        }
        else{
            rat[i] = 1.0*(d[i]/k[i]);    
        }
        }
        // rep(i,0,n-1) cout<<rat[i]<<" ";
        // cout<<endl;
        map<double,int> m;
        int ans[n];
        rep(i,0,n-1){
            if(m[rat[i]]){
                ans[i] = m[rat[i]] + 1;
               
            }else{
                ans[i]=1;
            }
             m[rat[i]]++;
        }
        
        
        rep(i,0,n-1) cout<<ans[i]<<" ";
        cout<<endl;
    }
    return 0;
}
