#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> f(n), s(n);
  map<int, pair<int, int>> m;
  for (int i = 0; i < n; ++i) {
    cin >> f[i] >> s[i];
    m[f[i]] = make_pair(i, 1);
    m[s[i]] = make_pair(i, 2);
  }
  int nf = n / 2, ns = n / 2;
  if (n & 1) {
    f[nf] < s[nf] ? ++nf : ++ns;
  }
  int mf = 0, ms = 0;
  auto it = m.begin();
  while (mf + ms != n) {
    mf += it->second.second == 1;
    ms += it->second.second == 2;
    ++it;
  }
  for (int i = 0; i < n; ++i)
    if (i < max(nf, mf))
      cout << "1";
    else
      cout << "0";
  cout << endl;
  for (int i = 0; i < n; ++i)
    if (i < max(ns, ms))
      cout << "1";
    else
      cout << "0";
}
