attrs = Array.new while line = $stdin.gets attrs << line.chomp.split end red = list.grep("RED") blue = list.grep("BLUE") if red.count==2 then puts("RED") else puts("BLUE") end