// Arup Guha
// 12/4/2017
// Solution to 2017 NCPC Problem D: Distinctive Character

import java.util.*;
import java.io.*;

public class d {

	public static void main(String[] args) throws Exception {

		BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer tok = new StringTokenizer(stdin.readLine());
		int items = Integer.parseInt(tok.nextToken());
		int n = Integer.parseInt(tok.nextToken());

		// Will store distances from any input string to rest.
		int[] dist = new int[1<<n];
		Arrays.fill(dist, n+1);
		LinkedList<Integer> q = new LinkedList<Integer>();

		// Store items that are starting pts for BFS.
		for (int i=0; i<items; i++) {
			int item = Integer.parseInt(stdin.readLine().trim(),2);
			q.offer(item);
			dist[item] = 0;
		}

		// Store result here.
		int res = 0, max = 0;

		// Run BFS.
		while (q.size() > 0) {

			// Get next.
			int cur = q.poll();

			// Try flipping each bit
			for (int i=1; i<(1<<n); i=(i<<1)) {

				// cur with bit i flipped.
				int next = cur ^ i;

				// Mark it!
				if (dist[next] == n+1) {
					dist[next] = dist[cur] + 1;
					q.offer(next);

					// Store if best so far.
					if (dist[next] > max) {
						res = next;
						max = dist[next];
					}
				}
			}
		}

		// Create result with n bits.
		String bin = Integer.toBinaryString(res);
		while (bin.length() < n) bin = "0" + bin;
		System.out.println(bin);
	}
}