import Data.List

main = do
  n <- readLn :: IO Int

  mapM_ print $ solve n

  where
    solve n = if m-n == 0 then [1..length xs] else delete (m-n) [1..length xs]
      where
        xs = takeWhile' (<n) (scanl1 (+) [1..])
        m = last xs
    takeWhile' f (x:xs) = x : (if f x then takeWhile' f xs else [])
