#include <bits/stdc++.h>
using namespace std;
int abs(int F) {
  if (F < 0) return -F;
  return F;
}
int main() {
  int n;
  cin >> n;
  vector<int> A(n, 0);
  vector<int> B(n, 0);
  vector<int> a(n, false);
  vector<int> b(n, false);
  for (int i = 0; i < n; i++) cin >> A[i] >> B[i];
  int j = 0;
  int q = 0;
  while (j + q < n) {
    if (A[j] < B[q]) {
      a[j] = true;
      j++;
    } else {
      b[q] = true;
      q++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (a[i] or i < (int)(n / 2))
      cout << 1;
    else
      cout << 0;
  }
  cout << endl;
  for (int i = 0; i < n; i++) {
    if (b[i] or i < (int)(n / 2))
      cout << 1;
    else
      cout << 0;
  }
  cout << endl;
}
