f=[x for x in map(int,input().split())] s=f.pop() print(("DEAD","SURVIVED")[s==1 or f.count(1)<2])