#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int main() {
  int n;
  cin >> n;
  vector<int> a(n), b(n);
  string sa(n, '0'), sb(n, '0');
  for (int i = (0); i < (n); i++) cin >> a[i] >> b[i];
  int k = n / 2;
  for (int i = (0); i < (k); i++) sa[i] = sb[i] = '1';
  int c = 0, i = 0, j = 0;
  while (c < n) {
    if (j >= n || (i < n && a[i] < b[j]))
      sa[i] = '1', i++;
    else
      sb[j] = '1', j++;
    c++;
  }
  cout << sa << endl << sb << endl;
  return 0;
}
