import qualified Data.ByteString.Char8 as BC
import Data.Maybe
import Data.List

readIntsLine :: IO [Int]
readIntsLine = map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine

main :: IO ()
main = do
  n <- readLn
  as <- readIntsLine
  let es = [x | x <- [2,4..n+4], x <= n]
  let os = [x | x <- [1,3..n+4], x <= n]
  let is = map fst . sortOn snd . zip [1..] $ if even n
                                              then reverse es ++ os
                                              else reverse os ++ es
  putStrLn . unwords . map (show . snd) . sortOn fst $ zip is as