func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 150005;   int mp[400], a[6], n, m, cnt, ans, f[6], type, t[2][4];   char ch[6], s[maxn];   vector<int> vc[maxn];   bool vis[6];   void calc(int o) {     if (o == 1) {       for (int i = 1; i <= n; i++) {         int u = i & 1, now, temp = 0, v = INT_MAX;         now = 1;         for (int j = 1; j <= m; j++) {           if (vc[i][j] != t[u][now]) temp++;           now++;           if (now > 2) now -= 2;         }         v = min(v, temp);         now = 2;         temp = 0;         for (int j = 1; j <= m; j++) {           if (vc[i][j] != t[u][now]) temp++;           now++;           if (now > 2) now -= 2;         }         v = min(v, temp);         cnt += v;       }     } else {       for (int i = 1; i <= m; i++) {         int u = i & 1, now, temp = 0, v = INT_MAX;         now = 1;         for (int j = 1; j <= n; j++) {           if (vc[j][i] != t[u][now]) temp++;           now++;           if (now > 2) now -= 2;         }         v = min(v, temp);         now = 2;         temp = 0;         for (int j = 1; j <= n; j++) {           if (vc[j][i] != t[u][now]) temp++;           now++;           if (now > 2) now -= 2;         }         v = min(v, temp);         cnt += v;       }     }   }   void dfs(int step) {     if (step == 4) {       t[0][1] = a[1];       t[0][2] = a[2];       t[1][1] = a[3];       t[1][2] = a[4];       cnt = 0;       calc(1);       if (cnt < ans) {         for (int i = 1; i <= 4; i++) f[i] = a[i];         type = 1;         ans = cnt;       }       cnt = 0;       calc(2);       if (cnt < ans) {         for (int i = 1; i <= 4; i++) f[i] = a[i];         type = 2;         ans = cnt;       }       return;     }     for (int i = 1; i <= 4; i++) {       if (vis[i]) continue;       vis[i] = true;       a[step + 1] = i;       dfs(step + 1);       vis[i] = false;     }   }   int main() {     mp[ A ] = 1;     mp[ G ] = 2;     mp[ C ] = 3;     mp[ T ] = 4;     ch[1] =  A ;     ch[2] =  G ;     ch[3] =  C ;     ch[4] =  T ;     scanf( %d %d , &n, &m);     for (int i = 1; i <= n; i++) vc[i].push_back(0);     for (int i = 1; i <= n; i++) {       scanf( %s , s + 1);       for (int j = 1; j <= m; j++) vc[i].push_back(mp[s[j]]);     }     ans = 1e9;     dfs(0);     t[0][1] = f[1];     t[0][2] = f[2];     t[1][1] = f[3];     t[1][2] = f[4];     if (type == 1) {       for (int i = 1; i <= n; i++) {         int u = i & 1, now, ca = 0, cb = 0;         now = 1;         for (int j = 1; j <= m; j++) {           if (vc[i][j] != t[u][now]) ca++;           now++;           if (now > 2) now -= 2;         }         now = 2;         for (int j = 1; j <= m; j++) {           if (vc[i][j] != t[u][now]) cb++;           now++;           if (now > 2) now -= 2;         }         if (ca < cb)           now = 1;         else           now = 2;         for (int j = 1; j <= m; j++) {           vc[i][j] = t[u][now];           now++;           if (now > 2) now -= 2;         }       }     } else {       for (int i = 1; i <= m; i++) {         int u = i & 1, now, ca = 0, cb = 0;         now = 1;         for (int j = 1; j <= n; j++) {           if (vc[j][i] != t[u][now]) ca++;           now++;           if (now > 2) now -= 2;         }         now = 2;         for (int j = 1; j <= n; j++) {           if (vc[j][i] != t[u][now]) cb++;           now++;           if (now > 2) now -= 2;         }         if (ca < cb)           now = 1;         else           now = 2;         for (int j = 1; j <= n; j++) {           vc[j][i] = t[u][now];           now++;           if (now > 2) now -= 2;         }       }     }     for (int i = 1; i <= n; i++, puts(  ))       for (int j = 1; j <= m; j++) printf( %c , ch[vc[i][j]]);     return 0;   }   