import qualified Control.Monad as M import qualified Data.List as L main :: IO () main = do n <- readLn :: IO Int M.forM_ [1..n] $ \i -> do putStrLn $ unwords . map show $ L.take i [1 .. n] ++ (reverse $ L.drop i [1 .. n])