// Problem: A. Puzzle From the Future
// Contest: Codeforces - Codeforces Round #696 (Div. 2)
// URL: https://codeforces.ml/contest/1474/problem/A
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i,x,n) for(int i = x;i <= n;++i)	

const int N = 1e5+7;
char s[N],ans[N];

int main()
{
    int T;scanf("%d",&T);
    while(T--)
    {
		int n;scanf("%d",&n);
		scanf("%s",s + 1);
		int last = -1;
		forn(i,1,n)
		{
			int c = s[i] - '0';
			if(c + 1 == last)	ans[i] = '0',last = c;
			else	ans[i] = '1',last = c + 1;
		}
		forn(i,1,n)	printf("%c",ans[i]);
		puts("");
    }
    return 0;
}
