#include <bits/stdc++.h>
#define iamspeed ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define tc ll t; cin >> t; while(t--)
#define ll long long
#define lld long double
#define endl '\n'
#define um unordered_map
#define mod 1000000007
#define maxi 1000005
using namespace std;

int main(){
iamspeed
tc{
int n;
cin >> n;
string s;
cin >> s;
int a[n];
int pre=0;
for(int i=0;i<n;i++){
    if(pre==2){
            if((s[i] - '0' == 1) )
        a[i]=0;
    else
        a[i]=1;
        }
    else if(pre==1){
        if( (s[i] - '0' == 1) )
            a[i]=1;
        else
            a[i]=0;
    }
    else
        a[i]=1;

    pre = a[i] + s[i]-'0';
}
for(int i=0;i<n;i++)
cout << a[i];

cout << endl;

}
    return 0;
    }

