#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n) {
  if (n < 2) {
    return 0;
  }
  if (n % 2 == 0) {
    return n == 2;
  }
  for (int i = 3; i * i <= n; i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
long long ncr(int n, int r) {
  if (n < r) return 0;
  if (r == 0) return 1;
  return n * ncr(n - 1, r - 1) / r;
}
int main() {
  int n;
  cin >> n;
  string s1(n, '0');
  string s2(n, '0');
  int m = n / 2;
  int cnt = 0;
  long long cura = 0;
  long long curb = 0;
  int ia = 0;
  int ib = 0;
  bool isA = 0;
  bool isB = 0;
  vector<long long> va;
  vector<long long> vb;
  for (int i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    va.push_back(a);
    vb.push_back(b);
    if (isA) {
      cura = va[ia];
    }
    if (isB) {
      curb = vb[ib];
    }
    if (i == 0) {
      cura = a;
      curb = b;
    }
    if (i < m) {
      s1[i] = '1';
      s2[i] = '1';
    }
    if (cnt < n) {
      if (cura < curb) {
        cnt++;
        s1[ia] = '1';
        ia++;
        isA = 1;
        isB = 0;
      } else if (cura > curb) {
        cnt++;
        s2[ib] = '1';
        ib++;
        isB = 1;
        isA = 0;
      }
    }
  }
  cout << s1 << "\n" << s2 << "\n";
  return 0;
}
