#include <bits/stdc++.h>
using namespace std;
int n, i, sz, j, k;
int ans1[200001], ans2[200001], a[200001], b[200001];
struct qwe {
  int x, pos, type;
} sum[300001];
bool cmp(qwe a, qwe b) { return a.x < b.x; }
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i] >> b[i];
    sum[++sz].x = a[i];
    sum[sz].type = 1;
    sum[sz].pos = i;
    sum[++sz].x = b[i];
    sum[sz].type = 2;
    sum[sz].pos = i;
  }
  sort(sum + 1, sum + sz + 1, cmp);
  for (j = 1; j <= n / 2; j++) {
    ans1[j] = 1;
    ans2[j] = 1;
  }
  for (i = 1; i <= n; i++)
    if (sum[i].type == 1)
      ans1[sum[i].pos] = 1;
    else
      ans2[sum[i].pos] = 1;
  for (i = 1; i <= n; i++) cout << ans1[i];
  cout << endl;
  for (i = 1; i <= n; i++) cout << ans2[i];
}
