loop do
  n, m = gets.split.map(&:to_i)
  
  break if n == 0
  
  sum = Array.new(m, 0)
  
  n.times do
    arr = gets.split.map(&:to_i)
    m.times do |i|
      sum[i] += arr[i]
    end
  end
  
  h = {}
  
  m.times do |i|
    h[i] = sum[i]
  end
  
  arr1 = []
  
  h.sort{|(k1, v1), (k2, v2)| v2 <=> v1 }.each do |arr2|
    arr1 << arr2[0] + 1
  end
  
  puts arr1.join(" ")
  
end