#include <bits/stdc++.h>
using namespace std;
struct stype {
  long time, pos;
  bool team;
};
int compare(stype a, stype b) { return a.time < b.time; }
int main() {
  vector<stype> total;
  string one = "", two = "";
  long n, i, f, s;
  stype push;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> f >> s;
    push.pos = i;
    push.team = 0;
    push.time = f;
    total.push_back(push);
    push.team = 1;
    push.time = s;
    total.push_back(push);
    if (i < n / 2) {
      one += "1";
      two += "1";
    } else {
      one += "0";
      two += "0";
    }
  }
  sort(total.begin(), total.end(), compare);
  for (i = 0; i < n; i++) {
    if (!total[i].team)
      one[total[i].pos] = '1';
    else
      two[total[i].pos] = '1';
  }
  cout << one << endl << two << endl;
  return 0;
}
