#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n;
  int a[100005], b[100005], ans_a[100005] = {0}, ans_b[100005] = {0};
  cin >> n;
  int j = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  int l = 0, r = 0;
  for (j = 0; j < n; j++) {
    if (a[l] < b[r]) {
      l++;
      ans_a[l - 1] = 1;
    } else {
      r++;
      ans_b[r - 1] = 1;
    }
  }
  for (i = 0; i < n / 2; i++) {
    ans_a[i] = 1;
    ans_b[i] = 1;
  }
  for (j = 0; j < n; j++) cout << ans_a[j];
  cout << endl;
  for (j = 0; j < n; j++) cout << ans_b[j];
  return 0;
}
