#include <bits/stdc++.h>
using namespace std;
pair<int, int> p[200001];
bool a[100001], b[100001];
bool cmp(pair<int, int> i, pair<int, int> j) {
  if (i.first > j.first) return false;
  if (i.first < j.first) return true;
  return true;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    p[2 * i] = make_pair(x, i);
    p[2 * i + 1] = make_pair(y, i + n);
  }
  sort(p, p + 2 * n, cmp);
  for (int i = 0; i < n; i++) {
    if (p[i].second < n) {
      a[p[i].second] = true;
    } else
      b[p[i].second - n] = true;
  }
  for (int i = 0; i < n; i++) {
    if (i < n / 2 || a[i])
      cout << 1;
    else
      cout << 0;
  }
  cout << endl;
  for (int i = 0; i < n; i++) {
    if (i < n / 2 || b[i])
      cout << 1;
    else
      cout << 0;
  }
  return 0;
}
