getNums :: IO [Integer]
main = interact (unlines . map (show . product . enumFromTo 1) . takeWhile (0 /=) . map read . lines)