#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, half, tag, res[2][100005] = {0};
  pair<int, int> score[100005];
  for (i = 0, cin >> n; i < n; i++)
    scanf("%d%d", &score[i].first, &score[i].second);
  half = (n - 1) / 2;
  for (i = 0; i < n / 2; i++) res[0][i] = 1, res[1][i] = 1;
  tag = n % 2 == 0 ? 1 : 0;
  if (score[half].first < score[half].second)
    for (i = 0; i <= half; i++)
      if (score[half + i + tag].first < score[half - i].second)
        res[0][half + i + tag] = 1;
      else
        break;
  else
    for (i = 0; i <= half; i++)
      if (score[half - i].first > score[half + i + tag].second)
        res[1][half + i + tag] = 1;
      else
        break;
  for (i = 0; i < 2; i++) {
    for (j = 0; j < n; j++) printf("%d", res[i][j]);
    puts("");
  }
  return 0;
}
