#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
struct person {
  int t, id, n;
};
person a[2 * N];
int n;
string f[2];
bool comp(person a, person b) { return a.t < b.t; }
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    f[0] += ((2 * i < n - 1) + '0');
    f[1] += ((2 * i < n - 1) + '0');
  }
  for (int i = 0; i < n; ++i) {
    cin >> a[2 * i].t >> a[2 * i + 1].t;
    a[2 * i].id = i;
    a[2 * i + 1].id = i;
    a[2 * i].n = 0;
    a[2 * i + 1].n = 1;
  }
  sort(a, a + 2 * n, comp);
  for (int i = 0; i < n; ++i) f[a[i].n][a[i].id] = '1';
  cout << f[0] << "\n" << f[1];
  return 0;
}
