func_code_string: #include <bits/stdc++.h>   using namespace std;   int n;   string ss;   int dp[200005][4];   char s[] = { R ,  G ,  B };   int calc(int u, int c) {     if (u == n) return 0;     if (dp[u][c] != -1) return dp[u][c];     int ret = n;     for (int i = 0; i < 3; i++) {       if (i == c) continue;       if (s[i] == ss[u])         ret = min(ret, calc(u + 1, i));       else         ret = min(ret, 1 + calc(u + 1, i));     }     return dp[u][c] = ret;   }   void print(int u, int c) {     if (u == n) return;     for (int i = 0; i < 3; i++) {       if (i == c) continue;       if (s[i] == ss[u]) {         if (dp[u][c] == calc(u + 1, i)) {           printf( %c , s[i]);           print(u + 1, i);           return;         }       } else {         if (dp[u][c] == 1 + calc(u + 1, i)) {           printf( %c , s[i]);           print(u + 1, i);           return;         }       }     }   }   int main() {     memset(dp, -1, sizeof dp);     cin >> n;     cin >> ss;     int ans = calc(0, 3);     cout << ans << endl;     print(0, 3);     return 0;   }   