main = print . solve . drop 1 . map read . words =<< getContents

solve :: [Int] -> [Int]
solve xs =
    let 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
