import scala.io.StdIn object Main { def main(args: Array[String]): Unit = { val in = StdIn.readLine().split(" ").map(_.toInt) val Ds = in.slice(0, 3) val S = in(3) println((Ds.sum, S) match { case (_, 1) => "SURVIVED" case (ds, _) if ds < 2 => "SURVIVED" case _ => "DEAD" }) } }