JOI '05 Final Round P1 - Questionnaire

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 128M

Problem type

IOI highschool has a plan to go on a school excursion. To decide where to go, the student council of the school has sent out questionaire to n students numbered 1 to n, where 1 \le n \le 1000. There are m (1 \le m \le 100) candidates numbered 1 to m for the destination of the excursion. Students are asked to answer OK to those destinations they like, and NG to others. Your task is to write a program which compute and output the destinations ordered according to the preference the students made, that is, a destination is to appear before another if the former has gained more OKs than the latter. If some destinations have gained the same number of OKs, then they should be ordered according to their numbers.

Input

The first line of the file contains two integers, n (1 \le n \le 1000) and m (1 \le m \le 100), separated by a single space character. The i + 1-st line represents the answer of i-th student, where OK is denoted by 1 and NG by 0. Those 1's and 0's should be separated by a space character. The j-th 0/1 is the answer to the j-th destination.

Output

The file should contain a single line containing m integers representing the destinations ordered according to the preference.

Sample Input

4 6
1 0 1 0 1 1
1 1 0 1 0 0
1 1 1 0 0 0
1 0 1 0 1 0

Sample Output

1 3 2 5 4 6

Comments

There are no comments at the moment.