#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005];
set<int> s;
set<int>::iterator itn, it;
int main(int argc, char* argv[]) {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    s.insert(a[i]);
    s.insert(b[i]);
  }
  itn = s.begin();
  for (int i = 0; i < n; i++) itn++;
  s.erase(itn, s.end());
  for (int i = 0; i < n / 2; i++) {
    cout << "1";
  }
  for (int i = n / 2; i < n; i++) {
    it = s.find(a[i]);
    if (it != s.end())
      cout << "1";
    else
      cout << "0";
  }
  cout << endl;
  for (int i = 0; i < n / 2; i++) {
    cout << "1";
  }
  for (int i = n / 2; i < n; i++) {
    it = s.find(b[i]);
    if (it != s.end())
      cout << "1";
    else
      cout << "0";
  }
  return 0;
}
