#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005];
int s1[100005] = {0}, s2[1000005] = {0};
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < n / 2; i++) s1[i] = s2[i] = 1;
  int c;
  int k = (n / 2);
  c = n - 2 * (k - 1);
  int i = (n / 2) - 1, j = (n / 2) - 1;
  int x = 0;
  while (1) {
    if (a[i] < b[j]) {
      s1[i] = 1;
      s2[j] = 0;
      x++;
      i++;
    } else {
      s1[i] = 0;
      s2[j] = 1;
      x++;
      j++;
    }
    if (x >= c) break;
  }
  c = n;
  i = 0, j = 0;
  x = 0;
  while (1) {
    if (a[i] < b[j]) {
      s1[i] = 1;
      s2[j] = 0;
      x++;
      i++;
    } else {
      s1[i] = 0;
      s2[j] = 1;
      x++;
      j++;
    }
    if (x >= c) break;
  }
  for (int i = 0; i < n / 2; i++) s1[i] = s2[i] = 1;
  for (int i = 0; i < n; i++) cout << s1[i];
  cout << endl;
  for (int i = 0; i < n; i++) cout << s2[i];
  cout << endl;
  return 0;
}
