#include <bits/stdc++.h>
using namespace std;
int m[1000], d1[1000];
int i, j;
int main() {
  int n;
  cin >> n;
  int a[n], b[n];
  int x[n], y[n];
  memset(x, 0, sizeof(x));
  memset(y, 0, sizeof(y));
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < n / 2; i++) {
    x[i] = 1;
    y[i] = 1;
  }
  for (int i = 0, j = 0, l = 0; l < n; l++) {
    if (a[i] < b[j]) {
      x[i] = 1;
      i++;
    } else {
      y[j] = 1;
      j++;
    }
  }
  for (int i = 0; i < n; i++) cout << x[i];
  cout << '\n';
  for (int i = 0; i < n; i++) cout << y[i];
  cout << '\n';
  return 0;
}
