#include <bits/stdc++.h>
using namespace std;
int semi1[100001];
int semi2[100001];
int ans1[100001];
int ans2[100001];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> semi1[i];
    cin >> semi2[i];
    ans1[i] = 0;
    ans2[i] = 0;
  }
  int i = 0;
  int j = 0;
  int pos = 0;
  while (i < n || j < n) {
    if (i >= n) {
      if (j < n / 2) {
        ans2[j] = 1;
      }
      if (pos < n) {
        ans2[j] = 1;
      }
      j++;
      pos++;
      continue;
    }
    if (j >= n) {
      if (i < n / 2) {
        ans1[i] = 1;
      }
      if (pos < n) {
        ans1[i] = 1;
      }
      i++;
      pos++;
      continue;
    }
    if (semi1[i] < semi2[j]) {
      if (i < n / 2) {
        ans1[i] = 1;
      }
      if (pos < n) {
        ans1[i] = 1;
      }
      i++;
      pos++;
    } else {
      if (j < n / 2) {
        ans2[j] = 1;
      }
      if (pos < n) {
        ans2[j] = 1;
      }
      j++;
      pos++;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans1[i];
  }
  cout << endl;
  for (int i = 0; i < n; i++) {
    cout << ans2[i];
  }
}
