list = gets.split.map(&:to_i) result = list[1] == 1 && list[2] == 1 && (list[0] == 1 || list[3] == 1) ? "DEAD" : "SURVIVED" puts result