#include <bits/stdc++.h>
int main() {
  std::vector<int> a, b;
  std::vector<int>::iterator ita, itb;
  int n, ai, bi, ra = 0, rb = 0;
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    std::cin >> ai >> bi;
    a.push_back(ai);
    b.push_back(bi);
  }
  ita = a.begin();
  itb = b.begin();
  for (int i = 0; i < n; i++) {
    if ((*ita) < (*itb)) {
      ra++;
      ita++;
    } else {
      rb++;
      itb++;
    }
  }
  if (ra < (n / 2)) ra = n / 2;
  if (rb < (n / 2)) rb = n / 2;
  for (int i = 0; i < n; i++) {
    if (ra > 0) {
      std::cout << "1";
      ra--;
    } else
      std::cout << "0";
  }
  std::cout << std::endl;
  for (int i = 0; i < n; i++) {
    if (rb > 0) {
      std::cout << "1";
      rb--;
    } else
      std::cout << "0";
  }
  return 0;
}
