
import           Data.List

renzoku :: Eq a => [a] -> [(a,Int)]
renzoku [] = []
renzoku (x1:xs1) =
    inner x1 1 xs1 []
    where
        inner s c [] result = ((s,c)  : result)
        inner s c (x2:xs2) result =
            if x2 == s
            then
                inner s (1 + c) xs2 result
            else 
                inner x2 1 xs2 ((s,c)  : result)

bunkatsu :: Int -> [a] -> [[a]]
bunkatsu c [] = []
bunkatsu c arr =
    inner 0 arr [] []
    where
        inner i [] result1 result2 = result1 : result2
        inner i (x2:xs2) result1 result2 = 
            if i < c 
            then 
                inner (1+i) xs2 (x2 : result1) result2
            else
                inner 1 xs2 [x2] (result1:result2)

main = do 
    str <- getLine
    putStrLn $ intercalate " "  $ map show $ concat $ map func $ bunkatsu 2 $ renzoku str
    where 
        func [x,y] = 
            (replicate (cx - 1) 0 ) ++ [ix+ax+iy] ++ [iy+ay+ix] ++ (replicate (cy - 1) 0)
            where 
                (sx,cx) = x
                (sy,cy) = y
                (ix,ax) = divMod cx 2
                (iy,ay) = divMod cy 2



