var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
while(true){
   var NM=Arr.shift();
   if(NM=="0 0")break;
   var nm=NM.split(" ").map(Number);
   var arr=[];
   for(var i=0;i<nm[0];i++)arr.push({x:(i+1),sum:0});
   for(var i=0;i<nm[1];i++){
      var data=(Arr.shift()).split(" ").map(Number);
      arr.forEach(function(v,j){arr[j].sum+=data[j];});
   }
   arr.sort(function(a,b){return b.sum-a.sum;});
   var c=[];
   arr.forEach(function(v){c.push(v.x);});
   console.log(c.join(" "));
}