#include <bits/stdc++.h>
using namespace std;
int n, a[100005], b[100005], ans[2][100005];
signed main() {
  ios::sync_with_stdio(false);
  cin >> n;
  vector<pair<int, int> > vec;
  for (int i = 1; i <= n; i++) {
    cin >> a[i] >> b[i];
    vec.push_back(make_pair(a[i], i));
    vec.push_back(make_pair(b[i], i + n));
  }
  sort(vec.begin(), vec.end());
  for (int i = 0; i < n; i++) {
    if (vec[i].second <= n)
      ans[0][vec[i].second] = 1;
    else
      ans[1][vec[i].second - n] = 1;
  }
  for (int i = 1; i <= n / 2; i++) ans[0][i] = ans[1][i] = 1;
  for (int i = 0; i < 2; i++) {
    for (int j = 1; j <= n; j++) cout << ans[i][j];
    cout << endl;
  }
  return 0;
}
