#!/usr/bin/ruby                                                                                                                                   
# -*- coding: utf-8 -*-                                                                                                                           

while true
  n, m = gets.split.map(&:to_i)
  if n == 0 && m == 0
    break
  end
  res = Array.new(m, 0)
  n.times {
    gets.split.map(&:to_i).each_with_index {|x, i|
      res[i] += x
    }
  }
  res.each_with_index.map {|x, i|
    [x, i+1]
  }.sort {|l, r|
    if l[0] == r[0]
      l[1] <=> r[1]
    else
      r[0] <=> l[0]
    end
  }.each_with_index {|x, i|
    if i > 0
      print " #{x[1]}"
    else
      print x[1]
    end
  }
  puts ""
end