#include <bits/stdc++.h>
using namespace std;
int n, a[100004], b[100004], c[200008];
int main() {
  scanf("%d", &n);
  map<int, int> M;
  int j = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    c[j++] = a[i];
    c[j++] = b[i];
  }
  sort(c, c + j);
  for (int i = 0; i < n; i++) M[c[i]] = 1;
  for (int i = 0; i < n / 2; i++) M[a[i]] = 1;
  for (int i = 0; i < n / 2; i++) M[b[i]] = 1;
  for (int i = 0; i < n; i++) printf("%d", M[a[i]]);
  printf("\n");
  for (int i = 0; i < n; i++) printf("%d", M[b[i]]);
  printf("\n");
  return 0;
}
