func_code_string: #include <bits/stdc++.h>   using namespace std;   const int INF = 1e8;   const int N = 300100;   int n, m, ans, nans;   string mat[N], ansmat[N], nmat[N];   void upd() {     if (nans >= ans) return;     ans = nans;     for (int i = 0; i < n; ++i) ansmat[i] = nmat[i];   }   int main() {     cin.tie(NULL);     ios_base::sync_with_stdio(0);     cin >> n >> m;     for (int i = 0; i < n; ++i) cin >> mat[i];     for (int i = 0; i < n; ++i) ansmat[i] = nmat[i] = mat[i];     vector<char> v = { A ,  C ,  G ,  T };     ans = INF;     do {       nans = 0;       for (int j = 0; j < m; ++j) {         int op1 = 0, op2 = 0;         for (int i = 0; i < n; ++i) {           op1 += v[2 * (j & 1) + (i & 1)] != mat[i][j];           op2 += v[2 * (j & 1) + !(i & 1)] != mat[i][j];         }         nans += min(op1, op2);         bool f = op1 > op2;         for (int i = 0; i < n; ++i) nmat[i][j] = v[2 * (j & 1) + (f ^ (i & 1))];       }       upd();       nans = 0;       for (int i = 0; i < n; ++i) {         int op1 = 0, op2 = 0;         for (int j = 0; j < m; ++j) {           op1 += v[2 * (i & 1) + (j & 1)] != mat[i][j];           op2 += v[2 * (i & 1) + !(j & 1)] != mat[i][j];         }         nans += min(op1, op2);         bool f = op1 > op2;         for (int j = 0; j < m; ++j) nmat[i][j] = v[2 * (i & 1) + (f ^ (j & 1))];       }       upd();     } while (next_permutation(v.begin(), v.end()));     for (int i = 0; i < n; ++i) cout << ansmat[i] <<   n ;     return 0;   }   