#include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define N 1010100
#define inf 1e9

#define loop(x, n, r) for(int i = x; i < n; i += r)

#define pb push_back
#define pp pair<int, int>

using namespace std;

int main(){
    ios::sync_with_stdio(0); cin.tie(0);
    int T = 1;
    cin >> T;
    while(T--){
        int n;
        cin >> n;
        string b;
        cin >> b;
        cout << '1';
        char prev = b[0] == '0' ? '1' : '2';
        loop(1, n, 1){
            if(prev == '2'){
                if(b[i] == '1')
                    cout << '0';
                else
                    cout << '1';
                prev = '1';
            }
            else if(prev == '1'){
                if(b[i] == '1'){
                    cout << '1';
                    prev = '2';
                }
                else{
                    cout << '0';
                    prev = '0';
                }
            }
            else{
                if(b[i] == '1'){
                    cout << '1';
                    prev = '2';
                }
                else{
                    cout << '1';
                    prev = '1';
                }
            }
        }
        cout << '\n';
    }
    return 0;
}
