#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--){
int n;
cin >> n;
vector<int>v;
string s;
cin >> s;
for(int i=0; i<n; i++){
int k = s[i] - '0';
v.push_back(k);
}
for(int i=0 ;i<n-1; i++){
if(s[i] == s[i+1])
v.push_back(1);
else if(s[i] != s[i+1])
v.push_back(0);
}
/*int x=0, y=0;
for(int i=0; i<v.size(); i++){
if(v[i] == 1)
x++;
else if(v[i] == 0)
y++;
}
if(y>x)cout << "YES" << endl;
else
cout << "NO" << endl;*/
for(int u:v)cout << u << " ";
cout << endl;
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCWludCB0OwoJY2luID4+IHQ7Cgl3aGlsZSh0LS0pewoJCWludCBuOwoJCWNpbiA+PiBuOwoJCXZlY3RvcjxpbnQ+djsKCQlzdHJpbmcgczsKCQljaW4gPj4gczsKCQlmb3IoaW50IGk9MDsgaTxuOyBpKyspewoJCQlpbnQgayA9IHNbaV0gLSAnMCc7CgkJCXYucHVzaF9iYWNrKGspOwoJCX0KCQlmb3IoaW50IGk9MCA7aTxuLTE7IGkrKyl7CgkJCWlmKHNbaV0gPT0gc1tpKzFdKQoJCQkJdi5wdXNoX2JhY2soMSk7CgkJCWVsc2UgaWYoc1tpXSAhPSBzW2krMV0pCgkJCQl2LnB1c2hfYmFjaygwKTsKCQl9CgkJLyppbnQgeD0wLCB5PTA7CgkJZm9yKGludCBpPTA7IGk8di5zaXplKCk7IGkrKyl7CgkJCWlmKHZbaV0gPT0gMSkKCQkJCXgrKzsKCQkJZWxzZSBpZih2W2ldID09IDApCgkJCQl5Kys7CgkJfQoJCWlmKHk+eCljb3V0IDw8ICJZRVMiIDw8IGVuZGw7CgkJZWxzZQoJCWNvdXQgPDwgIk5PIiA8PCBlbmRsOyovCgkJZm9yKGludCB1OnYpY291dCA8PCB1IDw8ICIgIjsKCQljb3V0IDw8IGVuZGw7Cgl9CglyZXR1cm4gMDsKfQ==