import qualified Data.Sequence as S

main :: IO ()
main = do
    _ <- getLine
    a <- map read . words <$> getLine :: IO [Int]
    mapM_ print . foldl f S.empty $ zip [0..] a
  where
    f :: S.Seq Int -> (Int,Int) -> S.Seq Int
    f q (i,x)
      | odd  i = x S.<| q
      | even i = q S.|> x
