while line = gets
  break if line.chomp == "0 0"
  ans = []
  n, m = line.split.map(&:to_i)
  q = Array.new(n).map{ gets.split.map(&:to_i) }
  
  q.transpose.map{ |arr| arr.inject(:+) }.each_with_index{ |sum, i| ans << [sum, i] }
  puts ans.sort_by{ |j, _| m - j }.map{ |_, k| k + 1 }.join(" ")
end