import Control.Monad.Primitive (PrimState)
import qualified Data.Vector.Unboxed as V
import qualified Data.Vector.Unboxed.Mutable as MV
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)

main :: IO ()
main = do
    n <- fst . fromJust . B.readInt <$> B.getLine
    as <- V.fromList . map (fst . fromJust . B.readInt) . B.words <$> B.getLine
    mv <- MV.unsafeNew (n + 1) :: IO (MV.MVector (PrimState IO) Int)
    m <- operate as n mv 0 (n `div` 2) (n `div` 2 + 1)
    v <- V.unsafeFreeze $ MV.slice m n mv
    putStrLn $ unwords $ map show $ V.toList v
    where
        operate as n mv i l r
            | i >= n = return (l + 1)
            | i `mod` 2 == (n - 1) `mod` 2 = do
                MV.unsafeWrite mv l (as V.! i)
                operate as n mv (i + 1) (l - 1) r
            | otherwise = do
                MV.unsafeWrite mv r (as V.! i)
                operate as n mv (i + 1) l (r + 1)
