import Control.Applicative( (<$>))
import Data.Array.IArray
import Data.Array.Unboxed

main = do
    n_ <- readLn
    as_ <- map read . words <$> getLine
    let
	arr::UArray Int Int
	arr = listArray (1,n_) $ as_

	enumDown 1 = let
			next = if even n_
				then enumUp 3
				else enumUp 2
		     in
			(arr!1):next
	enumDown 2 = (arr!2):(enumDown 1)
	enumDown n = (arr!n):(enumDown $ n-2)
	enumUp n
	  | n/=n_-1	= (arr!n):(enumUp $ n+2)
	  | otherwise	= [arr!(n_-1)]
    
	print' [] = return ()
	print' (i:is) = do
	    putStr $ (show i)++" "
	    print' is

    case n_ of
	1   -> print $ arr!1
	2   -> print' [arr!2, arr!1]
	n   -> print' $ enumDown n