#include<iostream>
#include<string>
#include<bits/stdc++.h>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<unordered_map>
typedef long long int lli;
typedef long long ll;
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std;
ll mod=1e9+7;
int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		string b;
		cin>>b;
		string a;
		for(int i=0;i<n;i++){
			a.push_back('0');
		}
		a[0]='1';
	
		for(int i=1;i<n;i++){
			if(b[i]=='1'){
				if(a[i-1]=='1'&&b[i-1]=='1')
					a[i]='0';
				if(a[i-1]=='0'&&b[i-1]=='1')
					a[i]='1';
				if(a[i-1]=='1'&&b[i-1]=='0')
					a[i]='1';
				if(a[i-1]=='0'&&b[i-1]=='0')
					a[i]='1';
			}
			if(b[i]=='0'){
				if(a[i-1]=='1'&&b[i-1]=='1')
					a[i]='1';
				if(a[i-1]=='0'&&b[i-1]=='1')
					a[i]='0';
				if(a[i-1]=='1'&&b[i-1]=='0')
					a[i]='0';
				if(a[i-1]=='0'&&b[i-1]=='0')
					a[i]='1';
			}
		}
		cout<<a<<endl;
	}
	
return 0;	
}
