class Rank
  attr_accessor :id, :point
  def initialize(place, point)
    @id = place
    @point = point
  end
end

while s = gets
  n, m = s.split.map(&:to_i)
  break if n == 0 && m == 0

  arr = Array.new(m)
  m.times do |i|
    arr[i] = Rank.new(i+1, 0)
  end

  n.times do |i|
    points = gets.split.map(&:to_i)
    m.times do |j|
      arr[j].point += points[j]
    end
  end

  arr.sort! do |a, b|
    if a.point == b.point
      a.id <=> b.id
    else
      b.point <=> a.point
    end
  end

  puts arr.map(&:id).join(" ")
end