#include<bits/stdc++.h>
using namespace std;
long long arr[1000000];
int main()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);   
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    string b,a;
    long long i,j,k,x,y,z,n,t;
    cin>>t;
    while (t--)
    {
    	cin>>n;
    	cin>>b;
    	a="1";
    	for (i=1;i<n;i++)
    	{
    		if (b[i-1]=='1' && a[i-1]=='1')
    		{
    			if (b[i]=='0')
    			{
    				a+='1';
				}
				else
				{
					a+='0';
				}
			}
    		if (b[i-1]=='1' && a[i-1]=='0')
    		{
    			if (b[i]=='0')
    			{
    				a+='0';
				}
				else
				{
					a+='1';
				}
			}		
    		if (b[i-1]=='0' && a[i-1]=='0')
    		{
    			a+='1';
			}	
    		if (b[i-1]=='0' && a[i-1]=='1')
    		{
    			if (b[i]=='0')
    			{
    				a+='0';
				}
				else
				{
					a+='1';
				}
			}					
		}
		cout<<a<<endl;
	}
}
