loop do
    n,m = gets.split(" ").map(&:to_i)
    break if n == 0 && m == 0
    place = Array.new(m).fill {|i| [i+1,0]} #[0] ??´??? [1] ????\¨??°
    n.times do
        a = gets.split(" ").map(&:to_i)
        0.upto(m-1) do |i|
            place[i][1] += a[i]
        end
    end
    new_place = place.sort {|i,j| if i[1] == j[1] then i[0] <=> j[0] else j[1] <=> i[1] end}
    puts new_place.map{|pl| pl[0]}.join(" ")
end