{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"MD","content":"## 题目描述\n\n有一个包含 $n$ 朵花的花环,第 $i$ 朵花的颜色 $s_i$ 是 `R`、`G` 或 `B`,分别表示红色、绿色、蓝色。\n\n你需要将一些花朵重新染色(将其改变为其他颜色),使得能构成一个**优秀的**花环。\n\n一个**优秀的**花环需要满足任意两朵颜色相同的花的距离能够被 $3$ 整除。即,如果用字符串 $t$ 表示优秀的花环,那么对于满足 $t_i \u003d t_j$ 的每一对下标 $(i, j)$,都需要满足 $|i - j| \\ mod \\ 3 \u003d 0$。$mod$ 表示取模,$|x|$ 表示绝对值。\n\n例如,`RGBRGBRG`、`GB`、`R`、`GRBGRBG`、`BRGBRGB` 是优秀的花环,而 `RR`、`RGBG` 则不是。\n\n请你求出最少需要改变多少个花朵的颜色,能够使花环变成优秀的。\n\n## 输入格式\n\n第一行包含一个整数 $n$($1 \\le n \\le 2 \\cdot 10^5$),表示花环上花朵的数量。\n\n第二行包含一个长度为 $n$ 的字符串 $s$,仅由 `R`、`G`、`B` 构成,表示花环上每朵花的颜色。\n\n## 输出格式\n\n第一行输出一个整数 $r$,表示需要改变颜色的花朵的最少数量。\n\n第二行输出一个长度为 $n$ 的字符串 $t$,表示改变颜色后优秀的花环。如果存在多种方案,输出任意一种即可。"}},{"title":"Sample 1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\nBRB\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\nGRB\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Sample 2","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e7\nRGBGRBB\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\nRGBRGBR\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}