#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int a[maxn], b[maxn], c[maxn];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    int x1, x2;
    if (n == 1) {
      cin >> x1 >> x2;
      if (x1 > x2) {
        printf("0\n1\n");
      } else {
        printf("1\n0\n");
      }
      return 0;
    }
    for (int i = 1; i <= n; i++) {
      scanf("%d %d", &a[i], &b[i]);
    }
    for (int i = n; i >= 1; i--) {
      int tmp = lower_bound(b + 1, b + n + 1, a[i]) - b - 1;
      if (tmp + i <= n || i <= n / 2) {
        x1 = i;
        break;
      }
    }
    for (int i = n; i >= 1; i--) {
      int tmp = lower_bound(a + 1, a + n + 1, b[i]) - a - 1;
      if (tmp + i <= n || i <= n / 2) {
        x2 = i;
        break;
      }
    }
    int flag1 = 0, flag2 = 0;
    for (int i = 1; i <= n; i++) {
      if (!flag1) {
        printf("1");
      } else {
        printf("0");
      }
      if (i == x1) {
        flag1 = 1;
      }
    }
    printf("\n");
    for (int i = 1; i <= n; i++) {
      if (!flag2) {
        printf("1");
      } else {
        printf("0");
      }
      if (i == x2) {
        flag2 = 1;
      }
    }
    printf("\n");
  }
  return 0;
}
