#include <bits/stdc++.h>
using namespace std;
int xx[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int yy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
const double pi = 3.14159265358;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long n, x, y, k, i;
  cin >> n;
  long a[n + 1], b[n + 1];
  for (i = 1; i <= n; i++) {
    cin >> a[i] >> b[i];
  }
  for (i = 1; i <= n; i++) {
    if (i * 2 <= n || a[i] < b[n + 1 - i])
      cout << "1";
    else
      cout << "0";
  }
  cout << endl;
  for (i = 1; i <= n; i++) {
    if (i * 2 <= n || b[i] < a[n + 1 - i])
      cout << "1";
    else
      cout << "0";
  }
  return 0;
}
