import Data.Array.IArray

main = putStrLn . unwords . map show . solve . drop 1 . map read . words =<< getContents

solve :: [Int] -> [Int]
solve xs =
    let xs' = listArray (0,length xs) xs :: Array Int Int
        n = [xs'!k | k <- takeWhile ((>) $ length xs) [0, 2..]]
        r = [xs'!k | k <- takeWhile ((>) $ length xs) [1, 3..]]
    in if odd $ length xs then reverse n ++ r else reverse r ++ n
