Олимпиадный тренинг

Задача 37095.


In the theatre there are N rows, each of which has M seats (seats). Information about the tickets sold is stored in a two-dimensional array, the line numbers of which correspond to the row numbers, and the column numbers to the seat numbers. If a ticket for a particular place is sold, then the value 2 is written to the array, if it is booked - 1, otherwise - 0. Identify the places that are most often booked and / or bought by the audience.

Input data: the first line sets the numbers N and M (0 <= N, M <= 25)
Next comes N lines of M numbers in each. Each number can be 0, 1 or 2
Output: display the numbers of all places (in one line, after one space), which are sold or booked most often.

Example:
Input Output
1 3 4
0 1 2 1 
1 2 2 0 
2 2 1 1 
2 3