#include <bits/stdc++.h>
using namespace std;
int a[100000 + 5], b[100000 + 5];
int va[100000 + 5], vb[100000 + 5];
int ans1[100000 + 5], ans2[100000 + 5];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d%d", &a[i], &b[i]);
  sort(a, a + n);
  sort(b, b + n);
  int j = 0;
  for (int i = 0; i < n; i++) {
    while (j < n && a[i] > b[j]) j++;
    va[i] = j;
  }
  j = 0;
  for (int i = 0; i < n; i++) {
    while (j < n && b[i] > a[j]) j++;
    vb[i] = j;
  }
  memset(ans1, 0, sizeof ans1);
  memset(ans2, 0, sizeof ans2);
  for (int i = 0; i < n / 2; i++) ans1[i] = ans2[i] = 1;
  for (int i = n / 2; i < n; i++) {
    if (n > va[i] + i) ans1[i] = 1;
    if (va[i] < n / 2) {
      if (n - n / 2 > i) ans1[i] = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    if (n > vb[i] + i) ans2[i] = 1;
    if (vb[i] < n / 2) {
      if (n - n / 2 > i) ans2[i] = 1;
    }
  }
  for (int i = 0; i < n; i++) printf("%d", ans1[i]);
  printf("\n");
  for (int i = 0; i < n; i++) printf("%d", ans2[i]);
  printf("\n");
  return 0;
}
