module Main where type Input = (Int, [Int]) type Output = Int parse :: String -> Input parse s = let y = read . head . words . head . lines $ s a = map read . words . (!!1) . lines $ s in (y, a) solve :: Input -> Output solve (y, a) = y - sum a render :: Output -> String render n | n < 0 = "red" | otherwise = show n main :: IO () main = interact ( render . solve . parse )