first_input = gets.split().map(&:to_i);
weather_map=Array.new(first_input[0]);
for i in 0...first_input[0]
  weather_map[i] = gets();
end
#result = Array.new(fisrt_input[0]);
for l in 0...first_input[0]
  for x in 0...first_input[1]
    for i in 0..x
      if(weather_map[l][x - i] == "c" && x != first_input[1]-1)
        print(i);print(" ");
        break
      end
      if(weather_map[l][x - i] == "c" && x == first_input[1]-1)
        print(i);
        break
      end
      if(i == x && x != first_input[1]-1)
        print("-1");print(" ");
      end
      if(i == x && x == first_input[1]-1)
        print("-1");
      end
    end
  end
  puts();
end