while (ary = gets.split.map(&:to_i)) != [0, 0]
  answer     = []
  key_ary    = []
  result_ary = []

  ary[1].times do |num|
    key_ary << (num + 1).to_s
    result_ary << 0
  end

  ary[0].times do
    tmp_ary = gets.split.map(&:to_i)
    result_ary = result_ary.zip(tmp_ary).map! {|a, b| a + b}
  end

  tmp_hash = Hash[*key_ary.zip(result_ary).flatten]
  tmp_hash = tmp_hash.sort_by {|key, value| -value}
  tmp_hash.each {|key, value| answer << key}
  p answer
end