#include <bits/stdc++.h>
using namespace std;
int _sortInt(const void *p1, const void *p2) {
  int v1 = *((int *)p1);
  int v2 = *((int *)p2);
  if (v1 == v2) return 0;
  if (v1 > v2) return 1;
  return -1;
}
void _calc(vector<int> &a1, vector<int> &a2, vector<int> &sa1, vector<int> &sa2,
           vector<int> &r, int n, int k) {
  int i, d;
  int p1, p2;
  for (i = 0; i < k; i++) {
    r[i] = 1;
    r[i + n] = 1;
  }
  p1 = k;
  p2 = k;
  d = n - 2 * k;
  for (i = 0; i < d; i++) {
    if ((p1 >= n) && (p2 >= n)) break;
    if (p1 >= n) {
      r[p2 + n] = 1;
      p2++;
      continue;
    } else if (p2 >= n) {
      r[p1] = 1;
      p1++;
      continue;
    }
    if (sa1[p1] < sa2[p2]) {
      r[p1] = 1;
      p1++;
    } else if (sa1[p1] > sa2[p2]) {
      r[p2 + n] = 1;
      p2++;
    } else {
      d++;
      r[p1] = 1;
      p1++;
    }
  }
}
void _solve() {
  int i, n, d;
  vector<int> a1, a2, sa1, sa2;
  vector<int> r;
  scanf("%d", &n);
  a1.resize(n);
  a2.resize(n);
  r.resize(2 * n);
  for (i = 0; i < n; i++) {
    scanf("%d %d", &a1[i], &a2[i]);
  }
  sa1 = a1;
  sa2 = a2;
  qsort(&*sa1.begin(), sa1.size(), sizeof(int), &_sortInt);
  qsort(&*sa2.begin(), sa2.size(), sizeof(int), &_sortInt);
  _calc(a1, a2, sa1, sa2, r, n, 0);
  _calc(a1, a2, sa1, sa2, r, n, n / 2);
  for (i = 0; i < n; i++) {
    if (r[i])
      printf("1");
    else
      printf("0");
  }
  printf("\n");
  for (i = 0; i < n; i++) {
    if (r[i + n])
      printf("1");
    else
      printf("0");
  }
}
int main() {
  _solve();
  return 0;
}
