import std.algorithm; import std.array; import std.conv; import std.math; import std.stdio; import std.string; import std.range; int readint() { return readln.chomp.to!int; } int[] readints() { return readln.split.map!(to!int).array; } bool calc(int[] xs) { if (xs[$ - 1] == 0 && xs.count!(e => e == 1) >= 2) return false; return true; } void main() { auto xs = readints(); writeln(calc(xs) ? "SURVIVED" : "DEAD"); }