#include <bits/stdc++.h>
using namespace std;
string s1, s2;
int main() {
  map<long long int, int> ans;
  int n, a[111111], b[111111], ab[222222], l = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    ab[l] = a[i];
    l++;
    ab[l] = b[i];
    l++;
  }
  sort(ab, ab + l);
  for (int i = 0; i < n; i++) {
    ans[ab[i]] = 1;
    if (i < n / 2) {
      ans[a[i]] = 1;
      ans[b[i]] = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    if (ans[a[i]] == 1) {
      s1.push_back('1');
    } else {
      s1.push_back('0');
    }
    if (ans[b[i]] == 1) {
      s2.push_back('1');
    } else {
      s2.push_back('0');
    }
  }
  cout << s1 << endl << s2;
}
