import Data.List

main :: IO ()
main = do
    getLine
    as <- map read . words <$> getLine
    putStrLn $ solve as

solve :: [Int] -> String
solve as = unwords $ map show $ xs ++ reverse ys
    where
        (xs,ys) = foldl' (\(bs,as) a -> (a:as,bs)) ([],[]) as
