func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long MAX = 2e5 + 10;   int n;   string s, xx =  RGB ;   int getID(char c) {     if (c ==  R )       return 1;     else if (c ==  G )       return 2;     return 3;   }   int last[4];   int dp[MAX][4][4][4];   int mn = 1e9;   vector<char> v, ans;   int tokyoGhoul(int cur, int cnt) {     if (cur == n) {       if (cnt < mn) {         mn = cnt;         ans = v;       }       return cnt;     }     int &ret = dp[cur][last[0]][last[1]][last[2]];     if (~ret) return ret;     ret = 1e18;     for (int i = 0; i < xx.size(); i++) {       int id = getID(xx[i]);       int prev = last[id];       char ch = xx[i];       if (prev == -1 || (cur - prev) != 1) {         v.push_back(ch);         last[id] = cur;         if (xx[i] != s[cur])           ret = min(ret, tokyoGhoul(cur + 1, cnt + 1));         else           ret = min(ret, tokyoGhoul(cur + 1, cnt));         last[id] = prev;         v.pop_back();       }     }     return ret;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cin >> n >> s;     vector<string> vv;     int cnt = 0, cnt2 = 0;     string s1 =   , s2 =   ;     for (int j = 0; j < 3; j++) {       cnt = 0, s1 =   ;       s1 += xx[j];       if (s[0] != s1[0]) cnt++;       for (int i = 1; i < n; i++) {         if (s[i] == s1[i - 1]) {           cnt++;           bool f = 1;           for (int j = 0; j < xx.size(); j++) {             if (s1[i - 1] != xx[j] && (i + 1 == n || s[i + 1] != xx[j])) {               s1 += xx[j];               f = 0;               break;             }           }           if (f)             for (int j = 0; j < xx.size(); j++) {               if (s[i - 1] != xx[j]) {                 s1 += xx[j];                 break;               }             }         } else           s1 += s[i];       }       if (cnt < mn) {         mn = cnt;         s2 = s1;       }     }     cout << mn << endl;     for (auto i : s2) cout << i;     cout << endl;   }   