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