#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005];
bool da[100005], db[100005];
void input() {
  int i, j, k, n;
  scanf("%d", &n);
  for ((i) = 0; (i) < (n); (i)++) scanf("%d %d", &a[i], &b[i]);
  i = j = 0;
  for ((k) = 0; (k) < (n); (k)++)
    if (a[i] < b[j])
      da[i] = true, i++;
    else
      db[j] = true, j++;
  for ((i) = 0; (i) < (n / 2); (i)++) da[i] = true, db[i] = true;
  for ((i) = 0; (i) < (n); (i)++)
    if (da[i])
      putchar('1');
    else
      putchar('0');
  putchar('\n');
  for ((i) = 0; (i) < (n); (i)++)
    if (db[i])
      putchar('1');
    else
      putchar('0');
}
int main() {
  input();
  return 0;
}
