#include <cstdio>
#include <algorithm>
#include <functional>
using namespace std;
struct Place {
	int num,pt;
	bool operator> (const Place &X) const {
		if(pt==X.pt) return num<X.num;
		else return pt>X.pt;
	}
};
Place places[100];
int main() {
	int n,m;
	while(scanf("%d %d",&n,&m),n) {
		for(int i=0;i<m;i++) places[i].num=i+1,places[i].pt=0;
		for(int i=0;i<n;i++) for(int j=0;j<m;j++) {
			int x; scanf("%d",&x); places[j].pt+=x;
		}
		sort(places,places+m,greater<Place>());
		for(int i=0;i<m-1;i++) printf("%d ",places[i].num);
		printf("%d\n",places[m-1].num);
	}
}