import scala.math._

object Main {
  val sc = new java.util.Scanner(System.in)
  def main(args: Array[String]) {
    while(true) {
      val n, m = sc.nextInt()
      if((n, m) == (0, 0)) {
        return
      }

      val a = Array.ofDim[Int](m, n)
      for(i <- 0 until n; j <- 0 until m) {
        a(j)(i) = sc.nextInt()
      }
      val sum = a.map(_.sum)
      println(sum.map(_ * -1).zipWithIndex.sorted.map(_._2 + 1).mkString(" "))
    }
  }
}