#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	while(true){
	
		int n,m; cin >> n >> m;
		if(n == 0) break;

		P site[105];
		for (int i = 0;i < m;i++){
			site[i] = P(0, i+1);
		}

		for (int i = 0;i < n;i++){
			for (int j = 0;j < m;j++){
				int tmp; cin >> tmp;
				if(!tmp) site[j].first++;
			}
		}

		sort(site,site+m);

		for (int i = 0;i < m;i++){
			cout << site[i].second << (i == m-1 ? "\n" : " " );
		}
	
	}

	return 0;

}
