h, w = gets.split.map(&:to_i)

h.times do
  str, ans = gets, [-1] * w
  
  w.times do |i|
    if str[i] == "c"
      c = 0
      for j in i...w
        ans[j] = c
        c += 1
      end
    end
  end
  
  puts ans.join(" ")
end