#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using namespace std;
const int N = 1e5 * 2 + 10;
const int inf = 1e9 * 2 + 10;
const ll INF = 1e18 * 2 + 10;
int nxt() {
  int x;
  cin >> x;
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  vector<pair<pair<int, int>, int> > v;
  int n;
  cin >> n;
  string ans1(n, '0'), ans2(n, '0');
  for (int i = (1); i <= (n); ++i) {
    int x, y;
    cin >> x >> y;
    if (i <= n / 2) ans1[i - 1] = ans2[i - 1] = '1';
    v.push_back({{x, i}, 1});
    v.push_back({{y, i}, 2});
  }
  sort((v).begin(), (v).end());
  for (int i = (0); i <= (n - 1); ++i) {
    if (v[i].second == 1)
      ans1[v[i].first.second - 1] = '1';
    else
      ans2[v[i].first.second - 1] = '1';
  }
  cout << ans1 << "\n" << ans2;
  return 0;
}
