#include <bits/stdc++.h>
using namespace std;
struct bezec {
  int sf;
  int sfm;
};
int main() {
  int n, a;
  cin >> n;
  map<int, bezec> M;
  vector<int> sf1;
  sf1.resize(n);
  vector<int> sf2;
  sf2.resize(n);
  for (int i = 1; i != n + 1; ++i) {
    cin >> a;
    M[a].sf = 0;
    M[a].sfm = i;
    cin >> a;
    M[a].sf = 1;
    M[a].sfm = i;
  }
  int i = 1;
  for (auto it = M.begin(); it != M.end(); ++it) {
    if ((*it).second.sfm <= n / 2 || i <= n) {
      if ((*it).second.sf == 0)
        sf1[((*it).second.sfm) - 1] = 1;
      else
        sf2[((*it).second.sfm) - 1] = 1;
    }
    ++i;
  }
  for (int i = 0; i != n; ++i) cout << sf1[i];
  cout << endl;
  for (int i = 0; i != n; ++i) cout << sf2[i];
  cout << endl;
}
