import Control.Applicative main :: IO () main = do fls <- words <$> getLine let ds = map read $ init fls s = read $ last fls putStrLn $ if s == 1 || length (filter (==1) ds) < 2 then "SURVIVED" else "DEAD"