#include <bits/stdc++.h>
using namespace std;
int months[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
const int M = (int)2e5 + 10;
int main() {
  int n, idx = 0, n1, n2, cnt1 = 0, cnt2 = 0;
  pair<int, int> arr[M];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &n1, &n2);
    arr[idx++] = {n1, 1};
    arr[idx++] = {n2, 2};
  }
  sort(arr, arr + idx);
  for (int i = 0; i < n; i++)
    cnt1 += arr[i].second == 1, cnt2 += arr[i].second == 2;
  for (int i = 0; i < n; i++) {
    if (i < max(n / 2, cnt1))
      printf("1");
    else
      printf("0");
  }
  printf("\n");
  for (int i = 0; i < n; i++) {
    if (i < max(n / 2, cnt2))
      printf("1");
    else
      printf("0");
  }
  return 0;
}
