color = { "RED" => 0, "BLUE" => 0 } while line = gets word = line.chomp color[word] += 1 end if color["RED"] > color["BLUE"] puts "RED" else puts "BLUE" end