#include <bits/stdc++.h>
using namespace std;
struct Result {
  int semifinal;
  int id;
  int time;
  Result(int sf, int i, int t) {
    semifinal = sf;
    id = i;
    time = t;
  }
};
bool cmp(const Result& a, const Result& b) { return a.time < b.time; }
int main() {
  ios::sync_with_stdio(0);
  vector<Result> total, first, second;
  vector<bool> used;
  int n;
  cin >> n;
  for (int i = 0; i < (int)n; i++) {
    int a, b;
    cin >> a >> b;
    first.push_back(Result(0, i, a));
    second.push_back(Result(1, i, b));
    total.push_back(Result(0, i, a));
    total.push_back(Result(1, i, b));
  }
  used.resize(2 * n);
  sort(total.begin(), total.end(), cmp);
  for (int i = 0; i < (int)n / 2; i++) used[i] = used[i + n] = true;
  for (int i = 0; i < (int)n; i++)
    used[(total[i].semifinal) * n + total[i].id] = true;
  for (int i = 0; i < (int)n; i++) cout << used[i];
  cout << endl;
  for (int i = 0; i < (int)n; i++) cout << used[i + n];
  cout << endl;
  return 0;
}
