#include <bits/stdc++.h>
#define int 						long long
#define ff 							first
#define ss 							second
#define pb 							push_back
#define ppb               			pop_back
#define pf                			push_front
#define ppf               			pop_front
#define mkp 						make_pair
#define pii 						pair<int,int>
#define vi 							vector<int>
#define vvi 						vector<vector<int>>
#define rep(i,s,e)                  for(int i=s;i<(int)e;i++)
using namespace std;

#define TRACE
#ifdef TRACE
#define trace(...) 					__f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << std::endl; }
template <typename Arg1, typename... Args> void __f(const char* names, Arg1&& arg1, Args&&... args) { const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...); }
#else
#define trace(...)
#endif
#define endl						'\n'

//---------------------------------------------------------------------------------------

//	ncr( , )
//	sieve( )
//  mod(base, power (or prime-2 for multiplicative modulo inverse), prime)



void solve();

signed main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("D:\\codes\\input.txt", "r", stdin);
	freopen("D:\\codes\\output.txt", "w", stdout);
#endif

#ifdef SIEVE
	sieve();
#endif
#ifdef NCR
	init();
#endif

	int t = 1;
	cin >> t;

	while (t--)
		solve();

	return 0;
}

const int N = 2e6 + 7, M = (int)1e9 + 7, inf = INT_MAX; const long long INF = LLONG_MAX;

void solve() {
	int n;
	string b;
	cin >> n >> b;

	vi d(n, 0);
	if (b[0] == '0')
		d[0] = 1;
	else
		d[0] = 2;

	rep(i, 1, n) {
		if (b[i] == '0') {
			if (d[i - 1] != 1)
				d[i] = 1;
			else
				d[i] = 0;
		}
		else {
			if (d[i - 1] != 2)
				d[i] = 2;
			else
				d[i] = 1;
		}
	}

	//cout << b << " ";
	string ans;
	rep(i, 0, n) {
		ans.pb((d[i] - (b[i] - '0')) + '0');
	}

	cout << ans << endl;



}