main :: IO ()
main = do
    n <- readLn
    mapM_ print $ solve n

solve :: Int -> [Int]
solve n = filter (\i -> sum [1 .. highest n] - i /= n) [1 .. highest n]

highest :: Int -> Int
highest n = head [ i | i <- [1 ..], i * (i + 1) `div` 2 >= n ]