object Main extends App {
    val in = io.Source.stdin.getLines.map(_.split(" ").map(_.toInt))
    for (Array(n, m) <- in if n != 0) {
        println(in.take(n).toSeq.transpose.zipWithIndex.sortWith((a, b) => a._1.sum > b._1.sum).map(_._2+1).mkString(" "))
    }
}