#include <cstdio>
#include <vector>
#include <algorithm>
#include <sstream>
#define REP(i,n) for(int i = 0; i < (int)(n); i++)

using namespace std;

int main(){
  for(;;){
    int n, m;
    scanf("%d %d", &n, &m);
    if(!(n|m)) { break; }

    int count[100];
    REP(i, m) {count[i] = 0;}
    REP(i, n){
      for(int j = 0; j < m; j++){
	int tmp;
	scanf("%d", &tmp);
	count[j]+=tmp;
      }
    }
    vector<pair<int, int> > ranking;
    REP(i,m) ranking.push_back(make_pair(count[i],-(i+1)));
    sort(ranking.begin(), ranking.end());
    reverse(ranking.begin(), ranking.end());
    stringstream s;
    for(auto iter = ranking.begin(); iter < ranking.end(); iter++){
      printf("%d", -(*iter).second);
      printf(iter + 1 == ranking.end() ? "\n" : " ");
    }
  }
}