#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535897932384626433832795;
long long int a[100005];
long long int b[100005];
long long int k[200005];
long long int c[100005];
long long int d[100005];
int main() {
  long long int n, m, i, j = 0, min = 0, l = 1;
  scanf("%lld", &n);
  for (i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
    scanf("%lld", &b[i]);
  }
  for (i = 0; i < n; i++) {
    k[j++] = a[i];
    k[j++] = b[i];
  }
  sort(k, k + 2 * n);
  min = k[n - 1];
  for (i = 0; 2 * i < n - 1; i++) {
    c[i] = 1;
    d[i] = 1;
  }
  for (; i < n; i++) {
    if (a[i] <= min) {
      c[i] = 1;
    }
    if (b[i] <= min) {
      d[i] = 1;
    }
  }
  for (i = 0; i < n; i++) {
    cout << c[i];
  }
  printf("\n");
  for (i = 0; i < n; i++) {
    cout << d[i];
  }
  return 0;
}
