import Data.List
main = getLine >>= putStrLn . unlines . map show . solve 10 [] . map read . words

solve 0 ls _ = reverse ls
solve cnt ls (r:d:x:_) = solve (cnt - 1) (r * x - d:ls) (r:d:r * x - d:[])