#include <iostream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cassert>
#include <cstdio>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>

#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;
typedef long long ll;

void solve()
{
  int n;
  cin >> n;
  string s;
  cin >> s;
  int prev = 1;
  cout << prev;

  for1(i, n-1)
  {
    if(s[i]==s[i-1])
    {
      if(s[i]=='1')
      {
        if(prev==1)
        {
          prev = 0;
          cout << 0;
        }
        else
        {
          prev = 1;
          cout << 1;
        }
      }
      else
      {
        if(prev == 0)
        {
          cout << 1;
          prev = 1;
        }
        else
        {
          cout << 0;
          prev = 0;
        }
      }
    }
    else
    {
      if(s[i]=='1')
      {
        if(prev==0)
        {
          cout << 1;
          prev = 1;
        }
        else
        {
          cout << 1;
          prev = 1;
        }
      }
      else
      {
        if(prev==0)
        {
          cout << 0;
        }
        else
        {
          prev = 1;
          cout << 1;
        }
      }
    }
  }
  cout << endl;


}


int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  t = 1;
  cin >> t;

  while(t--)
  {
    solve();
  }
}
