list = gets.split.map(&:to_i) count = 0 for val in list count += 1 break if count == 3 count = 0 if val == 0 end result = list[1] != 0 && count >= 2 ? "DEAD" : "SURVIVED" puts result