#include <bits/stdc++.h>
const double PI = acos(-1);
using namespace std;
const int mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  vector<pair<long long, long long> > a;
  string first(n, '0'), second(n, '0');
  for (int i = 0; i < n / 2; i++) {
    first[i] = '1';
    second[i] = '1';
  }
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    a.push_back(make_pair(x, 1));
    a.push_back(make_pair(y, 2));
  }
  sort(((a).begin()), ((a).end()));
  int p1 = 0, p2 = 0;
  for (int i = 0; i < n; i++) {
    if (a[i].second == 1) {
      first[p1++] = '1';
    } else {
      second[p2++] = '1';
    }
  }
  cout << first << "\n";
  cout << second << "\n";
  return 0;
}
