#include<iostream>
#include<string.h>
#include<string>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<bitset>
#include<math.h>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef long double db;
typedef vector<int> vi;
typedef pair<int,int> pii;
const int N=21,M=(1<<21)+100;
const db pi=acos(-1.0);
#define lowbit(x) ((x)&(-x))
#define sqr(x) (x)*(x)
#define rep(i,a,b) for (register int i=a;i<=b;i++)
#define per(i,a,b) for (register int i=a;i>=b;i--)
#define go(u,i) for (register int i=head[u],v=sq[i].to;i;i=sq[i].nxt,v=sq[i].to)
#define fir first
#define sec second
#define mkp make_pair
#define pb push_back
#define maxd 998244353
#define eps 1e-8
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

inline ll readll()
{
    ll x=0;int f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

int n,k,f[N][M],tr[M][2],low[M];
char s[M];

int main()
{
    n=read();k=read();
    rep(i,0,n)
    {
        scanf("%s",s);int tmp=(1<<i);
        rep(j,0,(1<<i)-1) f[i][tmp|j]=(s[j]-'0');
    }
    low[0]=-1;
    rep(i,2,(2<<n)-1) low[i]=low[i>>1]+1;
    rep(i,2,(2<<n)-1)
    {
        if ((i>>(low[i]-1))&1)
        {
            tr[i][1]=i^(1<<low[i]);
            tr[i][0]=tr[tr[i][1]][0];
        }
        else
        {
            tr[i][0]=i^(3<<(low[i]-1));
            tr[i][1]=tr[tr[i][0]][1];
        }
        //cout << i << " " << tr[i][0] << " " << tr[i][1] << endl;
    }
    //rep(i,1,(2<<n)-1) cout << low[i] << " ";cout << endl;
    per(i,n,1)
    {
        rep(j,(1<<i),(2<<n)-1)
        {
            if (!f[i][j]) continue;
            int s=(j>>i),t=(j&((1<<i)-1))^(1<<i);
            if (tr[t][0])
            {
                f[low[tr[t][0]]][(((s<<1)^1)<<low[tr[t][0]])^tr[t][0]]+=f[i][j];
            }
            if (tr[t][1])
            {
                f[low[tr[t][1]]][(((s<<1)^0)<<low[tr[t][1]])^tr[t][1]]+=f[i][j];
            }
            f[0][s]+=f[i][j];
        }
    }
    int ans=1;
    rep(i,2,(2<<n)-1)
        if ((f[0][i]>=k) && (low[i]>low[ans])) ans=i;
    //cout << ans << endl;
    per(i,low[ans]-1,0) printf("%d",(ans>>i)&1);
    return 0;
}
        
### Prompt

In CPP, your task is to solve the following problem:

You are given a set S of strings consisting of `0` and `1`, and an integer K.

Find the longest string that is a subsequence of K or more different strings in S. If there are multiple strings that satisfy this condition, find the lexicographically smallest such string.

Here, S is given in the format below:

* The data directly given to you is an integer N, and N+1 strings X_0,X_1,...,X_N. For every i (0\leq i\leq N), the length of X_i is 2^i.
* For every pair of two integers (i,j) (0\leq i\leq N,0\leq j\leq 2^i-1), the j-th character of X_i is `1` if and only if the binary representation of j with i digits (possibly with leading zeros) belongs to S. Here, the first and last characters in X_i are called the 0-th and (2^i-1)-th characters, respectively.
* S does not contain a string with length N+1 or more.



Here, a string A is a subsequence of another string B when there exists a sequence of integers t_1 < ... < t_{|A|} such that, for every i (1\leq i\leq |A|), the i-th character of A and the t_i-th character of B is equal.

Constraints

* 0 \leq N \leq 20
* X_i(0\leq i\leq N) is a string of length 2^i consisting of `0` and `1`.
* 1 \leq K \leq |S|
* K is an integer.

Input

Input is given from Standard Input in the following format:


N K
X_0
:
X_N


Output

Print the lexicographically smallest string among the longest strings that are subsequences of K or more different strings in S.

Examples

Input

3 4
1
01
1011
01001110


Output

10


Input

4 6
1
01
1011
10111010
1101110011111101


Output

100


Input

2 5
0
11
1111


Output

### Response

```cpp
#include<iostream>
#include<string.h>
#include<string>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<bitset>
#include<math.h>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef long double db;
typedef vector<int> vi;
typedef pair<int,int> pii;
const int N=21,M=(1<<21)+100;
const db pi=acos(-1.0);
#define lowbit(x) ((x)&(-x))
#define sqr(x) (x)*(x)
#define rep(i,a,b) for (register int i=a;i<=b;i++)
#define per(i,a,b) for (register int i=a;i>=b;i--)
#define go(u,i) for (register int i=head[u],v=sq[i].to;i;i=sq[i].nxt,v=sq[i].to)
#define fir first
#define sec second
#define mkp make_pair
#define pb push_back
#define maxd 998244353
#define eps 1e-8
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

inline ll readll()
{
    ll x=0;int f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

int n,k,f[N][M],tr[M][2],low[M];
char s[M];

int main()
{
    n=read();k=read();
    rep(i,0,n)
    {
        scanf("%s",s);int tmp=(1<<i);
        rep(j,0,(1<<i)-1) f[i][tmp|j]=(s[j]-'0');
    }
    low[0]=-1;
    rep(i,2,(2<<n)-1) low[i]=low[i>>1]+1;
    rep(i,2,(2<<n)-1)
    {
        if ((i>>(low[i]-1))&1)
        {
            tr[i][1]=i^(1<<low[i]);
            tr[i][0]=tr[tr[i][1]][0];
        }
        else
        {
            tr[i][0]=i^(3<<(low[i]-1));
            tr[i][1]=tr[tr[i][0]][1];
        }
        //cout << i << " " << tr[i][0] << " " << tr[i][1] << endl;
    }
    //rep(i,1,(2<<n)-1) cout << low[i] << " ";cout << endl;
    per(i,n,1)
    {
        rep(j,(1<<i),(2<<n)-1)
        {
            if (!f[i][j]) continue;
            int s=(j>>i),t=(j&((1<<i)-1))^(1<<i);
            if (tr[t][0])
            {
                f[low[tr[t][0]]][(((s<<1)^1)<<low[tr[t][0]])^tr[t][0]]+=f[i][j];
            }
            if (tr[t][1])
            {
                f[low[tr[t][1]]][(((s<<1)^0)<<low[tr[t][1]])^tr[t][1]]+=f[i][j];
            }
            f[0][s]+=f[i][j];
        }
    }
    int ans=1;
    rep(i,2,(2<<n)-1)
        if ((f[0][i]>=k) && (low[i]>low[ans])) ans=i;
    //cout << ans << endl;
    per(i,low[ans]-1,0) printf("%d",(ans>>i)&1);
    return 0;
}
        
```