Set#5461

Set

2 seconds
64 megabytes
Medium

– Will you be the third?

Folk Set

At the start of the session, each student and teacher received a unique card, described by criteria. Each criterion can take a value of , , or .

A set is a group of three cards such that, for each of the criteria, one of the following holds:

The Group D' gathered in their cabin, and it is known that Alex Johnson will join them in the evening. What card should he bring to maximize the number of sets that include his card?

Input

The first line contains two integers and (1 \le n \le 5000, 1 \le m \le 12, n < 3^m): the number of people in the group and the "dimension" of the set, respectively.

Each of the next lines describes a card: integers from to — the values of the corresponding criteria.

Output

Output a card for Alex Johnson such that the number of sets including his card and the existing cards of Group D' is maximized. If there are several such cards, you may print any of them.

Examples

Example 1

Loading
Loading