import Control.Arrow
import Control.Applicative
import Data.List

main :: IO ()
main = do
  { s <- getLine
  ; putStrLn $ unwords $ map show $ solve s
  }

solve :: String -> [Int]
solve = concat . unfoldr psi . runLength'
  where
    psi [] = Nothing
    psi (m:n:rs) = Just $ (block (m, n), rs)

block :: (Int, Int) -> [Int]
block (m, n) = ncomp (m-1) (0 :) . (m' :) . (n' :) . ncomp (n-1) (0 :) $ []
  where
    mn  = m + n
    mn2 = mn `div` 2
    m'  = if even m || even mn then mn2 else mn2 + 1
    n'  = mn - m'

ncomp :: Int -> (a -> a) -> (a -> a)
ncomp 0 f = id
ncomp n f = ncomp (pred n) f . f

runLength' :: Eq a => [a] -> [Int]
runLength' = unfoldr phi
  where
    phi []     = Nothing
    phi (x:xs) = case spanCount (x ==) xs of
      (m, zs) -> Just (succ m , zs)

spanCount :: (a -> Bool) -> [a] -> (Int, [a])
spanCount p = paraL psi (0,[])
  where
    psi x (xs, mzs)
      | p x       = first succ mzs
      | otherwise = (0,x:xs)

paraL :: (a -> ([a],b) -> b) -> b -> [a] -> b
paraL _   z []     = z
paraL phi z (x:xs) = phi x (xs, paraL phi z xs)
