def gets_nums
  gets.split(' ').map(&:to_i)
end
until (n_m = gets_nums) == [0, 0]
  puts n_m[0].times
    .map { gets_nums }
    .transpose
    .map {|a| a.reduce(:+) }
    .each.with_index(1)
    .sort_by {|sum, i| [-sum, i] }
    .map {|_, i| i }
    .join(' ')
end