
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;
#define tenp3 1001
#define tenp5 100001
#define tenp6 1000001
#define tenp9 1000000001
#define infinity 100000000000000000
#define mod 1000000007

typedef long long ll;
typedef vector<long long int> vll;
typedef pair<long long int, long long int> pll;
typedef vector<pair<long long int, long long int> > vpll;
// #define mat

#define pushb push_back
#define popb pop_back
#define F first
#define S second
#define mp make_pair

#define repe(i, a, b) for (long long int i = (long long int)(a); i < (long long int)(b); i++)
#define repv(x, y) for (auto x : y)
#define repvref(x, y) for (auto &x : y)
#define repit(it, x) for (auto it = x.begin(); it != x.end(); it++)
#define justSort(x) sort(x.begin(), x.end())
#define justSortR(x) sort(x.rbegin(), x.rend())
#define vec(typeOfVec, nameOfVec, sizeOfVec)      \
    vector<typeOfVec> nameOfVec(sizeOfVec);       \
    for (long long int i = 0; i < sizeOfVec; i++) \
    {                                             \
        cin >> nameOfVec[i];                      \
    }
#define print(x) cout << (x) << "\n";
#define rev(x) reverse(x.begin(), x.end())
#define copy(x, y) copy(x.begin(), x.end(), back_inserter(y));
#define mat(nameOfMat, typeOFMat, rows, cols, intitialValue) vector<vector<typeOFMat>> nameOfMat(rows, vector<typeOFMat>(cols, intitialValue));
#define gmat(nameOfMat, typeOFMat, rows, cols)                             \
    vector<vector<typeOFMat>> nameOfMat(rows, vector<typeOFMat>(cols, 0)); \
    for (long long int i = 0; i < rows; i++)                               \
    {                                                                      \
        for (long long int j = 0; j < cols; j++)                           \
        {                                                                  \
            cin >> nameOfMat[i][j];                                        \
        }                                                                  \
    }
#define pmat(nameOfMat)                                         \
    for (long long int i = 0; i < nameOfMat.size(); i++)        \
    {                                                           \
        for (long long int j = 0; j < nameOfMat[0].size(); j++) \
        {                                                       \
            cout << nameOfMat[i][j] << " ";                     \
        }                                                       \
        cout << "\n";                                           \
    }                                                           \
    cout << "\n";
#define preSum(fromArray, newArray, dataType)               \
    vector<dataType> newArray(fromArray.size() + 1);        \
    newArray[0] = 0;                                        \
    for (long long int qw = 0; qw < fromArray.size(); qw++) \
    {                                                       \
        newArray[qw + 1] = newArray[qw] + fromArray[qw];    \
    }
void printx(vll &x)
{
    for (auto i = x.begin(); i != x.end(); i++)
    {
        cout << (*i) << " ";
    }
    cout << "\n";
}
void printy(vll &x)
{
    for (auto i = x.begin(); i != x.end(); i++)
    {
        cout << (*i) << "\n";
    }
}

ll answer, n, k, m,tp,p, current, best, median;


int solve(int tn)
{   
    cin>>n;
    string b;
    cin>>b;
    string a=b;
    ll prev=0;
    repe(i,0,n){
        if(b[i]=='0'){
            if(prev==0 || prev==2){
                a[i]='1';
                prev=1;
            }
            else if(prev==1){
                a[i]='0';
                prev=0;
            }
        }
        else{
            if(prev==0 || prev==1){
                a[i]='1';
                prev=2;
            }
            else if(prev==2 ){
                a[i]='0';
                prev=1;
            }
        }

    }
    cout<<a<<"\n";
    return 0;
}

int main()
{
    ll t = 1;
    cin>>t;
    repe(w, 1, t + 1)
    {
        solve(w);
    }
    return 0;
}
