#include <bits/stdc++.h>
using namespace std;
template <class P, class Q>
void mmin(P &a, const Q &b) {
  if (b < a) a = b;
}
template <class P, class Q>
void mmax(P &a, const Q &b) {
  if (b > a) a = b;
}
template <class P>
P GCD(P a, P b) {
  if (a < b) swap(a, b);
  P c;
  while (b) {
    c = a % b;
    a = b;
    b = c;
  }
  return a;
}
const int MAXn = 2 * 100 * 1000;
int n;
pair<int, int> ar[MAXn];
bool mark[MAXn];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < (n); ++i) {
    int x, y;
    cin >> x >> y;
    ar[2 * i] = pair<int, int>(x, i);
    ar[2 * i + 1] = pair<int, int>(y, i + n);
  }
  sort(ar, ar + 2 * n);
  for (int i = 0; i < (n); ++i) mark[ar[i].second] = 1;
  for (int i = 0; i < (n / 2); ++i) mark[i] = mark[i + n] = 1;
  for (int i = 0; i < (n); ++i) cout << mark[i];
  cout << endl;
  for (int i = 0; i < (n); ++i) cout << mark[i + n];
  cout << endl;
  return 0;
}
