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

#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define mii map<int,int>
#define pqb priority_queue<int>
#define pqs priority_queue<int,vi,greater<int> >

#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626
#define MOD 1000000007
#define ps(x,y) fixed<<setprecision(y)<<x

void solve(){

	int n;
	cin>>n;

	string s;
	cin>>s;

	vector<pair<long double,int>> v;

	int b[n];
	for(int i=0;i<n;i++) b[i]=0;

	int cnt=0;
	for(int i=0;i<n;i++){
		if(s[i]=='D') cnt++;

		long double slope = i+1-cnt;
		if(cnt==0) v.push_back(mp(-1,i));
		else v.push_back(mp(slope/cnt,i));
	}

	sort(v.begin(),v.end());

	cnt=1;
	b[v[0].ss]=1;
	for(int i=1;i<n;i++){
		if(v[i].ff==v[i-1].ff){
			cnt++;
			b[v[i].ss]=cnt;
		}
		else{
			cnt=1;
			b[v[i].ss]=1;
		}
	}

	for(int i=0;i<n;i++) cout<<b[i]<<" ";
	cout<<endl;
	return;
}

int main(){

	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

	// freopen("input.txt", "r", stdin);
 //    freopen("error.txt", "w", stderr);
 //    freopen("output.txt", "w", stdout);
	
	int t=1;
	cin>>t;

	for(int i=1;i<=t;i++){
		// cout<<"Case #"<<i<<": ";
		solve();
	}
	
    cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
	return 0;
}
