#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int k = n / 2;
  int *a = new int[n];
  int *b = new int[n];
  int *c = new int[2 * n];
  int *kq1 = new int[n];
  int *kq2 = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < n; i++) {
    if (i < k || a[i] < b[n - i - 1])
      cout << 1;
    else
      cout << 0;
  }
  cout << endl;
  for (int i = 0; i < n; i++) {
    if (i < k || b[i] < a[n - i - 1])
      cout << 1;
    else
      cout << 0;
  }
}
