#include <bits/stdc++.h>   using namespace std;   template <class T, class U>   inline T max(T &a, U &b) {     return a > b ? a : b;   }   template <class T, class U>   inline T min(T &a, U &b) {     return a < b ? a : b;   }   template <class T>   T gcd(T a, T b) {     return (b != 0 ? gcd<T>(b, a % b) : a);   }   template <class T>   T lcm(T a, T b) {     return (a / gcd<T>(a, b) * b);   }   class CLASS_NAME {    public:     int method_NAME() {}   };   int main() {     int n;     string a, b;     cin >> n;     for (__typeof(0) i = 0; i <= n - 1; i++) a.push_back( 0 );     for (__typeof(0) i = 0; i <= n - 1; i++) b.push_back( 0 );     int k = n / 2;     for (__typeof(0) i = 0; i <= k - 1; i++) {       a[i] =  1 ;       b[i] =  1 ;     }     vector<int> v, arra, arrb;     for (__typeof(0) i = 0; i <= n - 1; i++) {       int x, y;       cin >> x >> y;       arra.push_back(x);       arrb.push_back(y);       v.push_back(x);       v.push_back(y);     }     sort(v.begin(), v.end());     int tmp = v[n - 1];     for (__typeof(0) i = 0; i <= n - 1; i++) {       if (arra[i] <= tmp) a[i] =  1 ;       if (arrb[i] <= tmp) b[i] =  1 ;     }     cout << a << endl << b << endl;     return 0;   }   