def questionnarie(a, m)
  dataset = m.times.map{ |x| [0, x+1]} # [生徒の投票数,場所の番号]
  a.each do |list|
    list.each_with_index do |x, i|
      dataset[i][0] += x
    end
  end
  puts dataset.sort_by{|votes, id| -votes}.map{|v, id| id}.join(' ') # 投票数でソートする
end

if __FILE__ == $0
  loop do
    n, m = gets.split.map(&:to_i)
    break if n.zero? && m.zero?
    a = n.times.map{gets.split.map(&:to_i)}
    questionnarie(a, m)
  end
end