import Data.List (sort) readMany :: (Read a) => IO [a] readMany = fmap (map read . words) getLine solve :: (Integer -> Integer) -> Integer -> Integer -> Integer solve f l r | l == r = 10^9 | abs (r - l) == 1 = l | f mid > 0 = solve f l mid | otherwise = solve f mid r where mid = (l + r) `div` 2 isValid f x = f x == 0 main = do [a, b, c] <- readMany let x0 = solve f (-10^12) (10^12) x1 = solve f (-10^12) x0 x2 = solve f (x0 + 1) (10^12) f x = x^3 + a * x^2 + b * x + c l = sort $ case (isValid f x1, isValid f x2, x1 /= x2) of (True, True, True) -> [x0, x1, x2] (True, _, _) -> let [x0', x1'] = sort [x0, x1] x2' = solve f (x1' - 1) x0' x3' = solve f (-10^12) x0' in [x0', x1', if isValid f x2' then x2' else x3'] (False, True, _) -> let [x0', x1'] = sort [x0, x2] x2' = solve f (x1' - 1) x0' x3' = solve f (x1' + 1) (10^12) in [x0', x1', if isValid f x2' then x2' else x3'] otherwise -> undefined -- print [x0, x1, x2] putStrLn $ unwords $ map show l