

#include <bits/stdc++.h>

using namespace std;

int main()
{int b;
cin>>b;
    while(b--){
    int x;
    cin>>x;
    string s1;
    cin>>s1;
    int sum=s1[0]-48+1;
     cout<<1;
    for(int i=1;i<x;i++)
    {
       if(sum==2)
       {cout<<1-s1[i]+48;
       sum=1;}
       else if(sum==1)
       {
           cout<<s1[i];
           sum=2*(s1[i]-48);
       }
       else if(sum==0)
       {
           sum=1+s1[i]-48;
           cout<<1;
       }
       
    }
    cout<<endl;
}
    return 0;
}
