#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v1;
  vector<int> v2;
  vector<int> v3(2 * n + 1);
  v1.push_back(0);
  v2.push_back(0);
  v3.push_back(0);
  for (int i = 1; i <= n; i++) {
    int temp1, temp2;
    cin >> temp1 >> temp2;
    v1.push_back(temp1);
    v2.push_back(temp2);
  }
  merge(v1.begin() + 1, v1.end(), v2.begin() + 1, v2.end(), v3.begin() + 1);
  vector<int> vv1;
  vector<int> vv2;
  vv1.push_back(0);
  vv2.push_back(0);
  for (int i = 1; i <= n; i++) {
    vv1.push_back(1);
    vv2.push_back(1);
  }
  int k = n / 2 + 1, j = n + 1;
  while (j <= 2 * n && k <= n) {
    if (v1[k] == v3[j]) {
      vv1[k] = 0;
      k++;
      j++;
    } else if (v1[k] < v3[j])
      k++;
    else
      j++;
  }
  for (int i = 1; i <= n; i++) {
    cout << vv1[i];
  }
  cout << endl;
  k = n / 2 + 1, j = n + 1;
  while (j <= 2 * n && k <= n) {
    if (v2[k] == v3[j]) {
      vv2[k] = 0;
      k++;
      j++;
    } else if (v2[k] < v3[j])
      k++;
    else
      j++;
  }
  for (int i = 1; i <= n; i++) {
    cout << vv2[i];
  }
  return 0;
}
