Most Distinctive Character

Choose a length-k bit string minimizing the maximum number of agreeing bits with any of n given strings, breaking ties lexicographically.

Medium7Bit manipulationDynamic programmingBFSNo attempts yetTime limit4sMemory limit512 MB

Problem

Tira wants to join a multiplayer game with nn other players. Every player uses one character, and a character has some features. The game has kk features in total, and each character has a subset of them.

The similarity of two characters AA and BB is counted like this. For each feature ff, if AA and BB both have ff, or if neither of them has ff, the similarity goes up by 11.

Tira has no character yet. She wants to build a new character so that the largest similarity between her character and any other character is as small as possible.

Given the characters of the other players, find such a character for Tira. Several characters can reach the smallest possible maximum similarity, and in that case the answer is the one that comes first in lexicographic order.

Input

The first line contains two integers nn and kk separated by a space. nn is the number of players other than Tira, with 1n1051 \le n \le 10^5, and kk is the number of features, with 1k201 \le k \le 20.

Each of the next nn lines holds one existing character as a string of kk digits, each of them 00 or 11. A 11 in position jj means the character has the jj-th feature, and a 00 means it does not. The same character may appear more than once.

Output

Print Tira's character on one line, in the same format as the input. If several characters give the same smallest maximum similarity, print only the lexicographically smallest of them. Two strings of the same length kk are compared position by position from the left, and 00 comes before 11 in every position.