fun main(args: Array<String>) {

    while(true){
    val num = readLine()
    if (num == "0 0") {
        break
    }
    // Your code here!

    val num_list = num!!.split(" ")
    val people = Integer.parseInt(num_list[0])
    val place =  Integer.parseInt(num_list[1])
    
    
    var res = IntArray(place)
    
    for (i in 1..people){
        var counter = 0
        readLine()!!.split(" ").forEach{
            res[counter] = res[counter] + Integer.parseInt(it)
            counter ++
        }
    }
    


    
    val sorted_res = res.sortedDescending()
    var  rank = 0
    var ans = IntArray(place)
    //println(sorted_res)
    for (i in sorted_res){
        var counter = 0
        for ( j in res){
           if (i == j ){
                //println("j=")
                //println(j)
               //print("i=")
               //println(i)
                //println("counter = ")
                //println(counter)
               //print("rank=")
               //println(rank)
                ans[rank] = counter+1
                rank ++
               res[counter] = res[counter] * -1
           }
        counter ++
       }
    }
   println(ans.joinToString(separator = " "))
   }
}

