#include<bits/stdc++.h>

using namespace std;
#define ll long long
#define mod 1000000007
#define pb push_back
#define fi first
#define se second
#define vi vector<int>
#define vl vector<long long>
#define pii pair<int,int>

void solve(){
	int n;
	cin>>n;
	string b;
	cin>>b;
	int a[n];
	a[0]=1;
	int prev=1;
	if(b[0]=='1'){ prev++;}
	for(int i=1;i<n;i++){
		int x=b[i]-'0';
		if(prev==2 && x==1){
			a[i]=0; prev=1; continue;
		}
		if(prev==2 && x==0){
			a[i]=1; prev=1; continue;
		}
		if(prev==1 && x==1){
			a[i]=1; prev=2; continue;
		}
		if(prev==1 && x==0){
			a[i]=0; prev=0; continue;
		}
		if(prev==0 && x==1){
			a[i]=1; prev=2; continue;
		}
		if(prev==0 && x==0){
			a[i]=1; prev=1; continue;
		}
	}
	for(int i=0;i<n;i++){
		cout<<a[i];
	}cout<<endl;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	cin>>t;
	//t=1;
	while(t--){
		solve();
	}
	
	return 0;
}