#include<bits/stdc++.h>
#include <iostream>

using namespace std;

int main()
{
    #ifdef LOCAL_EXEC
    #else
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #endif // LOCAL_EXEC
    long long int t,i,j,k,x,y,z,n;
    cin>>t;
    for(i=0;i<t;i++){
        cin>>n;
        string s,result;
        cin>>s;
        x=0;
        for(j=0;j<n;j++){
            if(s[j]-'0'+1!=x)
                result.push_back('1');
            else
                result.push_back('0');
            x=s[j]-'0'+result[j]-'0';
        }
        cout<<result<<endl;
    }
    return 0;
}
