#include <iostream>
#include <algorithm>
using namespace std;

struct s{
    int id, vote;
    bool operator<(const struct s& right) const{
        return (vote == right.vote)?(id <= right.id):(vote > right.vote);
    }
};

int main(){
    int n, m;
    struct s q[100];
    while( true ){
        cin >> n >> m;
        if( n == 0 && m == 0 ) break;
        for(int i = 0; i < m; i++){
            q[i].id = i+1;
            q[i].vote = 0;
        }
        for(int i = 0; i < n*m; i++){
            int k; 
            cin >> k;
            q[i%m].vote += k;
        }
        sort(q, q + m);
        for(int i = 0; i < m; i++){
            if( i ) cout << ' ';
            cout << q[i].id;
        }
        cout << endl;
    }
    return 0;
}