#include <stdio.h>
int main(){
int ans[100];
int n, m, i, j, tmp, max, rest;
while(1){
scanf("%d%d", &n, &m);
if(n == 0 && m == 0){
break;
}
for(i=0;i<m;i++){
ans[i] = 0;
}
max = 0;
for(i=0;i<n;i++){
for(j=0;j<m;j++){
scanf("%d", &tmp);
ans[j] += tmp;
if(max < ans[j]){
max = ans[j];
}
}
}
rest = m;
for(i=max;i>=0;i--){
for(j=0;j<m;j++){
if(ans[j] == i){
rest--;
if(rest == 0){
printf("%d", j+1);
} else{
printf("%d ", j+1);
}
}
}
}
printf("\n");
}
return 0;
}