School Trip Destination Ranking

No attempts yetTime limit1sMemory limit128 MB

Problem

A school is planning a field trip, so it surveyed its students. The students are numbered from $1$ to $n$, and the candidate destinations are numbered from $1$ to $m$. Each student submitted a form marking $1$ for a place they want to visit and $0$ for a place they do not want to visit.

Write a program that prints the destination numbers in descending order of how many students want to visit each place. When two places are wanted by the same number of students, print them in ascending order of destination number.

Input

The first line contains the number of students $n$ and the number of candidate destinations $m$, separated by a space.

Each of the next $n$ lines describes one student's answers: the $i$-th of these lines gives student $i$'s $m$ values separated by spaces, where $1$ means the student wants to visit that place and $0$ means they do not.

$1 \le n \le 1000$, $1 \le m \le 100$.

Output

Print the destination numbers on a single line separated by single spaces, ordered by the number of students who want to visit (most first), breaking ties by ascending destination number. End the line with a newline.