#encoding:utf-8 No.0505 2014.12.10
until (n,m = gets.chomp.split.map{|item| item.to_i}) == [0,0]
  count = Array.new(m,0)
  n.times do |i|
    ans = gets.chomp.split.map{|item| item.to_i}
    ans.each_with_index do |item,idx|
      count[idx] += item
    end
  end

  count = count.each_with_index.map{|item,idx| item = [item,idx+1]}
  count = count.sort_by{|item| item[0]}.reverse!
  count.each do |item|
    if item == count.last
      print "#{item[1]}\n"
    else
      print "#{item[1]} "
    end
  end
end