#include<bits/stdc++.h>
using namespace std;
#define int long long
#define INTMAX LLONG_MAX
int a[100010];
int max(int a,int b){
return (a>b?a:b);
}
signed main(){
ios::sync_with_stdio(NULL);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while(t--){
memset(a,0,sizeof(a));
int n;
cin >> n;
string b;
cin >> b;
int t = 0;
for(int i = 1;i<=n;i++){
if(b[i-1]=='0') a[i]=++t;
}
for(int i = 1;i<=n;i++){
if(b[i-1]=='1') a[i]=++t;
}
for(int i = 1;i<=n;i++){
cout << a[i] << ' ';
}
cout << '\n';
}
return 0;
}