#include <iostream>
#include <cassert>
#define REP(i,l,n) for(int i=l;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define NMAX 1000
#define MMAX 100
int flag;
int ans;
int n,m;
int input;
int table[MMAX];
using namespace std;
int main() {
  while(1){
    cin >> n;
    cin >> m;
    if(n==0&&m==0) return 0;
    rep(i,m){
      table[i] = 0;
    }
    rep(i,n){
      rep(j,m){
        cin >> input;
        table[j] += input;
      }
    }
    flag = 0;
    for(int i = n;i>=0;i--){
      rep(j,m){
        if(table[j] == i){
          if(flag == 1) cout << " ";
          cout << j+1;
          flag = 1;
        }
      }
    }
    cout << endl;
  }
  return 0;
}