class Application def main puts judgment( cut_received_code(get_code) ) end def judgment(value : Array) : String i = 0 value.each{ |v| (i += 1) if v == 1 } return ( (value[3] == 0) ? (i >= 2 ? "DEAD" : "SURVIVED") : "SURVIVED") end def cut_received_code(value : String) : Array value.split(" ").map(&.to_i) end def get_code : String return gets.to_s.chomp end end Application.new.main