#include <cstdio>
#include <vector>
#include <algorithm>
#include <functional>
#include <utility>

using namespace std;

int main(){
	vector<pair<int,int> > list;
	pair<int,int> pa;
	int n,m;
	int self;
	while(1){
		list.clear();
		scanf("%d %d",&n,&m);
		if(n == 0 && m == 0){ break; }
		for(int i = 0;i < m;i++){
			pa.first = 0;
			pa.second = m - i;
			list.push_back(pa);
		}
		for(int i = 0;i < n;i++){
			for(int j = 0;j < m;j++){
				scanf("%d",&self);
				list[j].first += self;
			}
		}
		sort(list.begin(),list.end(),greater<pair<int,int> >());
		vector< pair<int,int> >::iterator it;
		for(it = list.begin();it < list.end();it++){
			printf("%d",m - (*it).second + 1);
			if(it != list.end() - 1){
				printf(" ");
			}
		}
		printf("\n");
	}
}