def main(input = STDIN)
  while (n, m = input.gets.split(" ").map(&:to_i)) != [0, 0]
    arr = Array.new(m){|i|[0, i + 1]}
    n.times do
      input.gets.split(" ").map(&:to_i).each_with_index{|i, idx|arr[idx][0] += i}
    end
    puts arr.sort_by{|i|[-i[0], i[1]]}.map{|i|i[1]}.join(" ")
  end
end
main