import qualified Data.ByteString.Char8 as C
import qualified Data.Vector.Unboxed as V

main = C.interact $ put . sol . get

get = V.unfoldr (C.readInt . C.dropWhile (<'0'))

put = C.pack . unwords . map show . V.toList

sol v
  | even n    = V.reverse o V.++ e
  | otherwise = V.reverse e V.++ o
  where
  n = V.head v
  e = V.fromList $ map (v V.!) [1,3..n] 
  o = V.fromList $ map (v V.!) [2,4..n]