#include <bits/stdc++.h>
using namespace std;
const int Nmax = 3e5 + 5;
vector<int> a[Nmax];
vector<int> b[Nmax];
vector<int> ans[Nmax];
int cntr[Nmax][2][4];
int cntc[Nmax][2][4];
int n, m, sum;
void solve() {
  int sum = 1e9;
  for (int x = 0; x <= 3; x++)
    for (int y = x + 1; y <= 3; y++) {
      int z = -1;
      int t = -1;
      for (int i = 0; i <= 3; i++) {
        if (i != x && i != y) {
          if (z < 0)
            z = i;
          else
            t = i;
        }
      }
      int res = 0;
      for (int i = 1; i <= n; i++) {
        if (i & 1) {
          int xy = m - (cntr[i][1][x] + cntr[i][0][y]);
          int yx = m - (cntr[i][1][y] + cntr[i][0][x]);
          if (xy < yx) {
            res += xy;
            b[i][1] = x;
            b[i][2] = y;
          } else {
            res += yx;
            b[i][1] = y;
            b[i][2] = x;
          }
        } else {
          int zt = m - (cntr[i][1][z] + cntr[i][0][t]);
          int tz = m - (cntr[i][1][t] + cntr[i][0][z]);
          if (zt < tz) {
            res += zt;
            b[i][1] = z;
            b[i][2] = t;
          } else {
            res += tz;
            b[i][1] = t;
            b[i][2] = z;
          }
        }
      }
      if (res < sum) {
        sum = res;
        for (int i = 1; i <= n; i++) {
          for (int j = 1; j <= m; j += 2) {
            ans[i][j] = b[i][1];
          }
          for (int j = 2; j <= m; j += 2) {
            ans[i][j] = b[i][2];
          }
        }
      }
    }
  for (int x = 0; x <= 3; x++)
    for (int y = x + 1; y <= 3; y++) {
      int z = -1;
      int t = -1;
      for (int i = 0; i <= 3; i++) {
        if (i != x && i != y) {
          if (z < 0)
            z = i;
          else
            t = i;
        }
      }
      int res = 0;
      for (int i = 1; i <= m; i++) {
        if (i & 1) {
          int xy = n - (cntc[i][1][x] + cntc[i][0][y]);
          int yx = n - (cntc[i][1][y] + cntc[i][0][x]);
          if (xy < yx) {
            res += xy;
            b[1][i] = x;
            b[2][i] = y;
          } else {
            res += yx;
            b[1][i] = y;
            b[2][i] = x;
          }
        } else {
          int zt = n - (cntc[i][1][z] + cntc[i][0][t]);
          int tz = n - (cntc[i][1][t] + cntc[i][0][z]);
          if (zt < tz) {
            res += zt;
            b[1][i] = z;
            b[2][i] = t;
          } else {
            res += tz;
            b[1][i] = t;
            b[2][i] = z;
          }
        }
      }
      if (res < sum) {
        sum = res;
        for (int j = 1; j <= m; j++) {
          for (int i = 1; i <= n; i += 2) {
            ans[i][j] = b[1][j];
          }
          for (int i = 2; i <= n; i += 2) {
            ans[i][j] = b[2][j];
          }
        }
      }
    }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (ans[i][j] == 0)
        cout << 'A';
      else if (ans[i][j] == 1)
        cout << 'C';
      else if (ans[i][j] == 2)
        cout << 'G';
      else
        cout << 'T';
      if (j == m) cout << "\n";
    }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    a[i].push_back(0);
    b[i].resize(m + 1);
    ans[i].resize(m + 1);
    for (int j = 1; j <= m; j++) {
      char c;
      cin >> c;
      if (c == 'A')
        a[i].push_back(0);
      else if (c == 'C')
        a[i].push_back(1);
      else if (c == 'G')
        a[i].push_back(2);
      else
        a[i].push_back(3);
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      cntr[i][j & 1][a[i][j]]++;
      cntc[j][i & 1][a[i][j]]++;
    }
  solve();
  return 0;
}
