#include <bits/stdc++.h>
using namespace std;
const double pi = 2 * acos(0.0);
const int OO = 0x3f3f3f3f;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  map<long long, bool> mp;
  long long a[n], b[n], c[2 * n], a1[n], b1[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    a1[i] = a[i];
    b1[i] = b[i];
    c[i] = a[i];
    c[2 * n - i - 1] = b[i];
  }
  sort(a, a + n);
  sort(b, b + n);
  sort(c, c + (2 * n));
  for (int i = 0; i < n / 2; i++) mp[a[i]] = 1;
  for (int i = 0; i < n / 2; i++) mp[b[i]] = 1;
  for (int i = 0; i < n; i++) mp[c[i]] = 1;
  for (int i = 0; i < n; i++) cout << mp[a1[i]];
  cout << '\n';
  for (int i = 0; i < n; i++) cout << mp[b1[i]];
  return 0;
}
