#include using namespace std; int main() { char a, b, c, d; cin >> a >> b >> c >> d; if (d == '1') { cout << "SURVIVED" << endl; } else if ((a == '1'&&b == '1') || (a == '1'&&c == '1') || (c == '1'&&b == '1')) { cout << "DEAD" << endl; } else { cout << "SURVIVED" << endl; } }