#include <bits/stdc++.h>
using namespace std;
vector<int> arr;
map<int, int> mp;
int main() {
  int n;
  cin >> n;
  string s1 = "", s2 = "";
  for (int i = 1; i <= n; ++i) {
    int x, y;
    cin >> x >> y;
    arr.push_back(x);
    arr.push_back(y);
    mp[x]++;
    s1 += '0';
    s2 += '0';
    if (i * 2 <= n) {
      s1[i - 1] = '1', s2[i - 1] = '1';
    }
  }
  sort(arr.begin(), arr.end());
  for (int i = 0, k = 0, m = 0; i < arr.size(); ++i) {
    if (mp[arr[i]] != 0 && (i + 1) <= n)
      s1[k++] = '1';
    else if ((i + 1) <= n)
      s2[m++] = '1';
  }
  cout << s1 << endl << s2;
  return 0;
}
