#include <bits/stdc++.h>
using namespace std;
struct node {
  int type;
  int num;
} a[1000000 + 10], b[1000000 + 10], f[2 * 1000000 + 10];
int cmp(const void *_a, const void *_b) {
  node *a = (node *)_a;
  node *b = (node *)_b;
  return a->num - b->num;
}
int main() {
  int n;
  int c, d;
  int cur;
  int ans1, ans2;
  while (scanf("%d", &n) > 0) {
    cur = 0;
    ans1 = ans2 = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d %d", &c, &d);
      a[i].type = 0;
      a[i].num = c;
      b[i].type = 1;
      b[i].num = d;
    }
    for (int i = 0; i < n; i++) {
      f[cur].type = a[i].type;
      f[cur].num = a[i].num;
      cur++;
    }
    for (int i = 0; i < n; i++) {
      f[cur].type = b[i].type;
      f[cur].num = b[i].num;
      cur++;
    }
    qsort(f, cur, sizeof(node), cmp);
    for (int i = 0; i < n; i++) {
      if (f[i].type == 0)
        ans1++;
      else
        ans2++;
    }
    if (ans1 <= n / 2) {
      for (int i = 0; i < n / 2; i++) printf("1");
      for (int i = n / 2; i < n; i++) printf("0");
      printf("\n");
    } else {
      for (int i = 0; i < ans1; i++) printf("1");
      for (int i = ans1; i < n; i++) printf("0");
      printf("\n");
    }
    if (ans2 <= n / 2) {
      for (int i = 0; i < n / 2; i++) printf("1");
      for (int i = n / 2; i < n; i++) printf("0");
      printf("\n");
    } else {
      for (int i = 0; i < ans2; i++) printf("1");
      for (int i = ans2; i < n; i++) printf("0");
      printf("\n");
    }
  }
  return 0;
}
