#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
struct node {
  int ty;
  int va;
  int xu;
} t[maxn * 2];
bool cmp(node a, node b) { return a.va < b.va; }
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int ta = -1, tb = -1;
    for (int i = 0; i < n; i++) {
      scanf("%d %d", &t[i].va, &t[i + n].va);
      t[i].ty = 0;
      t[i + n].ty = 1;
      t[i].xu = t[i + n].xu = i;
    }
    sort(t, t + n * 2, cmp);
    for (int i = n - 1; i >= 0; i--) {
      if (ta == -1 && t[i].ty == 0) {
        ta = t[i].xu;
      }
      if (tb == -1 && t[i].ty == 1) {
        tb = t[i].xu;
      }
      if (ta != -1 && tb != -1) {
        break;
      }
    }
    ta = max(ta, n / 2 - 1);
    tb = max(tb, n / 2 - 1);
    for (int i = 0; i <= ta; i++) {
      putchar('1');
    }
    for (int i = ta + 1; i < n; i++) {
      putchar('0');
    }
    puts("");
    for (int i = 0; i <= tb; i++) {
      putchar('1');
    }
    for (int i = tb + 1; i < n; i++) {
      putchar('0');
    }
    puts("");
  }
  return 0;
}
