func_code_string: #include <bits/stdc++.h>   using namespace std;   char s[200005];   int n;   int mem[200005][27];   int dirr[200005][27];   bool vis[200005][27];   char other(char c, char d) {     if ( a  != c &&  a  != d) return  a ;     if ( b  != c &&  b  != d) return  b ;     return  c ;   }   int solve(int ind, int lst) {     if (ind >= n) return 0;     if (vis[ind][lst]) return mem[ind][lst];     vis[ind][lst] = 1;     int ans1 = -1, ans2 = -1, ans = -1, dir = -1;     if (s[ind] -  a  != lst) ans1 = solve(ind + 1, s[ind] -  a );     ans2 = 1 + solve(ind + 1, other(s[ind + 1], lst +  a ) -  a );     if (ans1 == -1 || ans2 <= ans1)       dir = 1, ans = ans2;     else       dir = 0, ans = ans1;     dirr[ind][lst] = dir;     return mem[ind][lst] = ans;   }   int main() {     ios::sync_with_stdio(false);     scanf( %s , s);     n = strlen(s);     solve(0, 26);     int lst = 26;     for (int i = 0; i < n; i++)       if (dirr[i][lst] == 0)         lst = s[i] -  a ;       else         s[i] = lst = other(s[i + 1], lst +  a ), lst -=  a ;     puts(s);     return 0;   }   