#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")  
#pragma GCC target("avx,avx2,fma")
 
#define f(i,a,b) for(ll i = a; i < (ll) b ; i++ ) 
#define af(i,a,b) for(ll i = a; i >= (ll) b ; i--)
#define rep(i,a,b,k) for(ll  i = a; i < (ll) b ; i+= k )
#define arep(i,a,b,k) for(ll i = a; i >= (ll) b ; i-= k)
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(), a.end()
#define sz(a) (ll) a.size()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define inter   ios::sync_with_stdio(false);cin.tie(0)
#define inter   ios::sync_with_stdio(false);cin.tie(0)

// policy-based




using namespace std;

typedef long long ll; // int or long long
typedef long double ld;
typedef pair<ll,ll> ii ;
typedef vector<ll>  vi ;
typedef vector<ii> vii ;

const ll MAX = 3e5 + 100;
const ll inf = 1e9;
const ll mod = 998244353;



int main(){
	fastio;
	ll tc = 1,n;
	string s,ans = "";
 	cin >> tc;
	while(tc--){
		cin >> n >> 	s;
		ans = "1";
		ll ant = s[0]-'0' + 1;
		f(i,1,s.size()){
			if(s[i]-'0' + 1 == ant) 
				ans.push_back('0'),ant = s[i]-'0';
			else
				ans.push_back('1'),ant = s[i]-'0' + 1;

		}
		cout << ans << endl;
	} 

    return 0;
}

