str = gets.chomp *dead_flags, survived_flag = str.split.map { _1.to_i } if survived_flag == 1 || dead_flags.count(1) < 2 puts "SURVIVED" else puts "DEAD" end