#ifdef LOCAL
#include <prettyprint.hpp>
#endif
#include<bits/stdc++.h>
#define endl '\n'
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define lg2(x) __lg(x)
#define rem_dupl(x) sort(all(x)); x.erase(unique(all(x)), x.end())
using namespace std;

typedef long long ll;
typedef double db;
typedef pair<int,int> ii;
#define x first
#define y second

mt19937 rand32(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rand64(chrono::steady_clock::now().time_since_epoch().count());

const db eps = 1e-9;
const int maxn = (int)2e5 + 5;
const ll mod = (int)1e9 + 7; // 998244353

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cout.setf(ios::fixed); cout.precision(0);

    int n, m, p;
    cin >> n >> m >> p;
    vector<ll> a(n);
    for(auto &x:a){
        x = 0;
        for(int i = 0; i < m; i++){
            char j; cin >> j;
            if(j == '1')
                x |= (1ll<<i);
        }
    }

    ll ans = 0;

    for(int iter = 0; iter < 50; iter++){

        ll s = a[rand32() % n];
        vector<int> bits;

        for(int i = 0; i < m; i++)
            if(s & (1ll<<i))
                bits.push_back(i);

        int p = bits.size();    
        vector<int>cnt(1<<p, 0), cnt2(1<<p, 0);

        for(auto &x:a){
            int y = 0;
            for(int i = 0; i < p; i++){
                if(x & (1ll<<bits[i]))
                    y |= (1<<i);
            }
            cnt[y]++;
        }

        for(int mask = (1<<p) - 1; mask >= 0; mask--){  
            for(int s = mask; s; s = (s - 1) & mask){
                cnt2[s] += cnt[mask];
            }
        } 

        for(int mask = 0; mask < (1<<p); mask++){
            if(2*cnt2[mask] >= n){
                if(__builtin_popcountll(ans) < __builtin_popcount(mask)){
                    ans = 0;
                    for(int i = 0; i < p; i++)
                        if(mask & (1ll<<i))
                            ans |= (1ll<<bits[i]);
                }
            }
        }
    }   


    for(int i = 0; i < m; i++)
        cout << ((ans >> i) & 1);
    
    return 0;
}