#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int a[n], b[n];
  vector<pair<int, int>> v;
  map<int, int> make_pair;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    make_pair[a[i]] = i;
    make_pair[b[i]] = i;
    v.push_back({a[i], 1});
    v.push_back({b[i], 2});
  }
  sort(v.begin(), v.end());
  int a1[n], b1[n];
  for (int i = 0; i < n; i++) {
    a1[i] = 0;
    b1[i] = 0;
  }
  for (int i = 0; i < n / 2; i++) {
    a1[i] = 1;
    b1[i] = 1;
  }
  for (int i = 0; i < n; i++) {
    if (v[i].second == 1) {
      a1[make_pair[v[i].first]] = 1;
    } else if (v[i].second == 2) {
      b1[make_pair[v[i].first]] = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << a1[i];
  }
  cout << "\n";
  for (int i = 0; i < n; i++) {
    cout << b1[i];
  }
}
