#include <bits/stdc++.h>
using namespace std;
void files();
int N;
pair<int, pair<int, int> > V[2 * 100000 + 5];
char S[3][100000 + 5];
int main() {
  int i, k = 0, a, b, c;
  scanf("%d", &N);
  for (i = 1; i <= N; i++) {
    scanf("%d%d", &a, &b);
    V[++k] = make_pair(a, make_pair(i, 1));
    V[++k] = make_pair(b, make_pair(i, 2));
    S[1][i] = S[2][i] = '0';
  }
  sort(V + 1, V + k + 1);
  for (i = 1; i <= N; i++) {
    a = V[i].first;
    b = V[i].second.first;
    c = V[i].second.second;
    S[c][b] = '1';
    S[1][i / 2] = '1';
    S[2][i / 2] = '1';
  }
  printf("%s\n%s\n", S[1] + 1, S[2] + 1);
  return 0;
}
void files() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
