#include <iostream>
using namespace std;

int main() {
   int t,n,i;
   char a[100000],b[100000],d[100000];
   cin>> t;
   while(t--)
   {
        cin>> n;
        cin>> b;
        if(b[0]=='1')
        {
             d[0]='2';
        }
        else{
             d[0]='1';
        }
        for(i=1;i<n;i++)
        {
             if((b[i]=='0')||(b[i]=='1')&&d[i-1]=='2')
             {
                  d[i]='1';
             }
             if((b[i]=='1')&&d[i-1]=='1')
             {
                  d[i]='2';
             }
              if((b[i]=='0')&&d[i-1]=='1')
             {
                  d[i]='0';
             }
              if((b[i]=='1')&&d[i-1]=='0')
             {
                  d[i]='2';
             }
              if((b[i]=='0')&&d[i-1]=='0')
             {
                  d[i]='1';
             }
        }
        for(i=0;i<n;i++)
        {
             cout<<d[i]-b[i];
        }
        cout<< endl;
   }
	// your code goes here
	return 0;
}
