#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i < (n);i++)
using namespace std;
using ll = long long;
using Pii = pair<int, int>;

int main() {
    int t;
    cin >> t;

    while(t--) {
        int n;
        cin >> n;
        string s1, s2, s3;
        cin >> s1 >> s2 >> s3;
        rep(i, n) cout << '1';
        rep(i, n) cout << '0';
        cout << '1';
        cout << endl;
        }
    }



#include <bits/stdc++.h>
using namespace std;

int main()
{
  int n;
  cin >> n;
  
  vector<int> p(n);
  for (int i = 0; i < n; i++) {
    cin >> p.at(i);
  }
  
  int min = 0;
  set<int> numSet;
  for (int num : p) {
    numSet.insert(num);
    while(numSet.count(min)) {
      min++;
    }
    cout << min << endl;
  }
}