#include <bits/stdc++.h>
using namespace std;
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long power(long long n, long long k) {
  long long power = 1;
  for (int i = 0; i < k; i++) {
    power = (power * n);
  }
  return power;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
pair<int, int> arr[100000 + 50];
vector<int> v;
map<int, int> mp;
int main() {
  fast();
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i].first >> arr[i].second;
    v.push_back(arr[i].first);
    v.push_back(arr[i].second);
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    mp[v[i]] = 0;
  }
  for (int i = 0; i < v.size() / 2; i++) {
    mp[v[i]] = 1;
  }
  for (int i = 0; i < n / 2; i++) {
    mp[arr[i].first] = 1;
    mp[arr[i].second] = 1;
  }
  string s1 = "", s2 = "";
  for (int i = 0; i < n; i++) {
    s1 += mp[arr[i].first] + '0';
    s2 += mp[arr[i].second] + '0';
  }
  cout << s1 << "\n" << s2;
  return 0;
}
