#include <bits/stdc++.h>
using namespace std;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
unsigned long long lcm(unsigned long long a, unsigned long long b) {
  return (a * b) / gcd(a, b);
}
unsigned long long nCr(unsigned long long n, unsigned long long r) {
  unsigned long long p = 1, k = 1;
  if (n - r < r) r = n - r;
  if (r != 0) {
    while (r) {
      p *= n;
      k *= r;
      unsigned long long m = gcd(p, k);
      p /= m;
      k /= m;
      n--;
      r--;
    }
  } else
    p = 1;
  return p;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  map<long long, bool> m;
  string s = "", z = "";
  vector<pair<long long, int>> v;
  for (int i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    m[x] = 1;
    char t = '0';
    v.push_back(make_pair(x, i));
    v.push_back(make_pair(y, i));
    if (i < n / 2) t = '1';
    s += t;
    z += t;
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < n; i++) {
    if (m[v[i].first])
      s[v[i].second] = '1';
    else
      z[v[i].second] = '1';
  }
  cout << s << endl << z;
  return 0;
}
