module Main where
import Data.List

int = read :: String -> Int

splitLength :: Eq a => Int -> [a] -> [[a]]
splitLength n = map (take n) . takeWhile (/=[]) . iterate (drop n) 

main = interact $ printer . solver . parser

printer = unlines . (:[]) . unwords . map show

parser = map int . words

solver (n:as) = result 
  where
    isOdd = odd n
    tmp2 = if isOdd then tail as else as 
    tmp1 = splitLength 2 tmp2
    p1 = map (!!0) tmp1
    p2 = map (!!1) tmp1
    result = if isOdd 
      then reverse p2 ++ (head as : p1)
      else reverse p2 ++ p1

