import Control.Monad (replicateM) main :: IO () main = putStrLn . unwords . map show . solve =<< readLn solve :: Int -> [Int] solve k = (++ [1]) . map succ . init . build $ [1 .. 2 ^ k - 1] build :: [Int] -> [Int] build [] = [] build xs = xs !! l : build a ++ build b where l = length xs `div` 2 a = take l xs b = drop (succ l) xs