main :: IO () main = interact $ f . words f :: [String] -> String f [d1, d2, d3, s] | s == "1" = "SURVIVED" | otherwise = if a >= 2 then "DEAD" else "SURVIVED" where a = sum $ map (read :: String -> Int) [d1, d2, d3]