loop{
  n, m = readline.split.map{|c| c.to_i}
  break if n == 0 && m == 0

  anq = []
  n.times{
    anq << readline.split.map{|c| c.to_i}
  }
  sum = anq.transpose.map{|v| v.inject(:+) }
  idx = (0...m).to_a
  i = 0
  puts idx.sort_by{|v| [-sum[v], i+1]}.map{|c| c+1}.join(" ")
}