import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

void main(){
	
	int n = read.to!int;
	int k = read.to!int;
	
	long[][] as;
	foreach(i; 0 .. n + 1){
		as ~= readln.chomp.map!(x => x.to!long - '0').array;
		}
	
	debug writeln("as:", as);
	
	long[] q1, q2;
	foreach_reverse(i, q; as){
		debug writeln("q:", q);
		if(q1.length == q.length) foreach(j, a; q) q[j] += q1[j];
		if(q2.length == q.length) foreach(j, a; q) q[j] += q2[j];
		debug writeln("q1:", q1);
		debug writeln("q2:", q2);
		debug writeln("q:", q);
		foreach(j, a; q) if(a >= k){
			writeln(toBinaryString(j, i));
			return;
			}
		q1 = new long[](q.length / 2);
		q2 = new long[](q.length / 2);
		foreach(j; 0 .. q.length / 2){
			q1[j] = q[j] + q[q1.length + j];
			q2[j] = q[j * 2] + q[j * 2 + 1];
			}
		}
	
	writeln("");
	
	}


string toBinaryString(long x, int n){
	debug writeln("x:", x, " n:", n);
	string ans = "";
	foreach(i; 0 .. n){
		if(x % 2) ans = "1" ~ ans;
		else ans = "0" ~ ans;
		x /= 2;
		}
	return ans;
	}