list = gets.split.map(&:to_i) count = 0 flag = 0 for i in 0...list.size do count += 1 if list[i] == 1 if count < 2 && list[i] == 0 count = 0 break elsif count >= 2 break end end puts count == 0 ? "SURVIVED" : "DEAD"