#include <bits/stdc++.h>
#define int long long 
#define ll long long
#define pb push_back
#define fr first
#define sc second
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rep(i,a,n) for(int i=a;i<n;i++)
#define N 1000000005

using namespace std;
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
const int M  = 1000007;
int t;
cin>>t;
while(t--){
      int n;
      cin>>n;
      string s,s1,r;
      cin>>s;
    s1.pb('1');
    if(s[0]=='0') r+="1";
    else r+="2";
      rep(i,1,n){
        if(s[i]=='0'&&r[i-1]=='1') {s1+="0";r+="0";}
        else if(s[i]=='0'&&r[i-1]=='2'){s1+="1";r+="1";}
        else if(s[i]=='0'&&r[i-1]=='0'){s1+="1";r+="1";}
        else if(s[i]=='1'&&r[i-1]=='2'){s1+="0";r+="1";}
        else if(s[i]=='1'&&r[i-1]=='1'){s1+="1";r+="2";}
        else if(s[i]=='1'&&r[i-1]=='0'){s1+="1";r+="2";}
      }
      cout<<s1<<endl; 
     }
  }





