fun main(args:Array<String>?): Unit {

    while(true){
    
        val score: Array<IntArray>
        
        val (n, m) = readLine()!!.split(' ').map(String::toInt)
        // nは生徒の人数
        // mは旅行候補の場所の数
        if(n==0 && m==0)break;
        
        score = Array(m) { IntArray(2) }
        // スコア用配列
        
		for (i in 0 until m) {
            score[i][1] = i+1
        }
        
        for (i in 0..n-1){
		    val s = readLine()!!.split(' ').map(String::toInt)
		    
		    for(j in 0..m-1){
		        
		        score[j][0] -= s[j]
		        
		    }
		    
		}
	
	    val sortedList = score.sortedWith(compareBy({ it[0] }, { it[1] }))
	
        val res = Array<Int>(m, {0})
        
        for (i in 0 until m) {
            res[i] = sortedList[i][1]
        }

        
        println(res.joinToString(" "))
        
    }
    
}
