module Main where
import Control.Monad
import Control.Applicative
import Data.Maybe
import Data.List
import qualified Text.Printf
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString as BC

------------------------------------------

main :: IO ()
main = do
  [n,_] <- readInts
  cloud <- replicateM n getLine
  mapM_ solve cloud

solve :: String -> IO ()
solve line = foldM_ f (-1, 0) line >> putStrLn ""
  where f (prv, idx) c = do
          let prv' = if c == 'c' then idx else prv
          when (idx > 0) $ putStr " "
          putStr $ show (if prv' < 0 then -1 else idx - prv')
          return (prv', idx+1)

------------------------------------------

{- Int input -}

parseInt :: BC.ByteString -> Int
parseInt = fst . fromJust . BC.readInt

parseInts :: BC.ByteString -> [Int]
parseInts = map parseInt <$> BC.words

readInt :: IO Int
readInt = parseInt <$> BC.getLine

readInts :: IO [Int]
readInts = parseInts <$> BC.getLine

{- Double Formatting -}

doubleFmt :: Double -> String
doubleFmt = Text.Printf.printf "%.12f"