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

int main(void){
  vector<pair<int, int> > cnt; // cnt[i] = {vote cnt, cand id}
  int n,m;
  
  while(true){
    cin >> n >> m;
    if (n==0 && m==0) break;
    cnt = vector<pair<int, int> >(m);
    for (int i=0; i<m; i++){
      cnt[i].first = 0;
      cnt[i].second = i+1;
    }
    for (int i=0; i<n; i++){
      for (int j=0; j<m; j++){
        int t;
        cin >> t;
        cnt[j].first -= t;
      }
    }
    stable_sort(cnt.begin(), cnt.end());
    cout << cnt[0].second;
    for (int i=1; i<m; i++){
      cout << " " << cnt[i].second;
    }
    cout << endl;
  }
  return 0;
}

