#include <bits/stdc++.h>
const int N = 100005;
int n, a[N], b[N];
int an[N], bn[N];
void Deal() {
  int i;
  for (i = 0; i < n / 2; i++) an[i] = bn[i] = 1;
  int ida = 0, idb = 0;
  for (i = 0; i < n; i++)
    if (a[ida] < b[idb])
      an[ida++] = 1;
    else
      bn[idb++] = 1;
}
int main() {
  scanf("%d", &n);
  memset(an, 0, sizeof(an));
  memset(bn, 0, sizeof(bn));
  int i;
  for (i = 0; i < n; i++) scanf("%d%d", &a[i], &b[i]);
  Deal();
  for (i = 0; i < n; i++) printf("%d", an[i]);
  printf("\n");
  for (i = 0; i < n; i++) printf("%d", bn[i]);
  printf("\n");
  return 0;
}
