import Control.Applicative
import Control.Monad
import Data.Maybe
import Data.List

main = read . head . words <$> getLine >>= flip replicateM getLine >>= mapM_ (putStrLn . unwords . map (show . fromMaybe (-1)) . tail . scanl (\m c -> if c=='c' then Just 0 else (+1) <$> m) Nothing)
