#include <bits/stdc++.h>
using namespace std;
template <class T>
string toString(T value) {
  ostringstream sout;
  sout << value;
  return sout.str();
}
int main() {
  long long i, j, k, n;
  cin >> n;
  vector<pair<long long, long long> > v;
  string s1 = "", s2;
  for (i = 0; i < n / 2; i++) s1 += '1';
  for (i = 0; i < n - n / 2; i++) s1 += '0';
  s2 = s1;
  for (i = 0; i < n; i++) {
    cin >> j >> k;
    v.push_back(make_pair(j, i));
    v.push_back(make_pair(k, i + 100006));
  }
  sort(v.begin(), v.end());
  for (i = 0; i < n; i++) {
    if (v[i].second >= 100006)
      s2[v[i].second - 100006] = '1';
    else
      s1[v[i].second] = '1';
  }
  cout << s1 << endl << s2 << endl;
  return 0;
}
