import           Data.List
import           Control.Applicative
import           Control.Monad
import           Control.Monad.State

extract (n1 : n2 : ns) = n1 : extract ns
extract [n1          ] = [n1]
extract _              = []

main = extract <$> getLine >>= putStrLn
