#include <bits/stdc++.h>
using namespace std;
struct node {
  int shu, name, w;
} k[200010];
bool cmp(node x, node y) { return x.shu < y.shu; }
int n;
int a[100010], b[100010];
int a1[100010], b1[100010];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i] >> b[i];
    k[i].shu = a[i];
    k[n + i].shu = b[i];
    k[i].w = k[n + i].w = i;
    k[i].name = 0;
    k[n + i].name = 1;
  }
  sort(k + 1, k + 2 * n + 1, cmp);
  for (int j = 1; j <= n / 2; j++) a1[j] = b1[j] = 1;
  for (int j = 1; j <= n; j++) {
    if (k[j].name == 0)
      a1[k[j].w] = 1;
    else
      b1[k[j].w] = 1;
  }
  for (int i = 1; i <= n; i++) cout << a1[i];
  cout << '\n';
  for (int i = 1; i <= n; i++) cout << b1[i];
  return 0;
}
