#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<string> t(n);
  for (int i = 0; i < n; ++i) cin >> t[i];
  char c[] = "ACGT";
  int solc = n * m + 1;
  string sol[2];
  int dir = 0;
  do {
    {
      string tt[2];
      tt[0].resize(m);
      tt[1].resize(m);
      for (int i = 0; i < m; ++i) tt[0][i] = c[i % 4];
      for (int i = 0; i < m; ++i) tt[1][i] = c[(i + 2) % 4];
      int cnt = 0;
      for (int i = 0; i < m; ++i) {
        int res1 = 0, res2 = 0;
        for (int j = 0; j < n; ++j) res1 += t[j][i] != tt[j % 2][i];
        swap(tt[0][i], tt[1][i]);
        for (int j = 0; j < n; ++j) res2 += t[j][i] != tt[j % 2][i];
        swap(tt[0][i], tt[1][i]);
        cnt += min(res1, res2);
        if (res1 > res2) swap(tt[0][i], tt[1][i]);
      }
      if (cnt < solc) {
        dir = 1;
        solc = cnt;
        sol[0] = tt[0];
        sol[1] = tt[1];
      }
    }
    {
      string tt[2];
      tt[0].resize(n);
      tt[1].resize(n);
      for (int i = 0; i < n; ++i) tt[0][i] = c[i % 4];
      for (int i = 0; i < n; ++i) tt[1][i] = c[(i + 2) % 4];
      int cnt = 0;
      for (int i = 0; i < n; ++i) {
        int res1 = 0, res2 = 0;
        for (int j = 0; j < m; ++j) res1 += t[i][j] != tt[j % 2][i];
        swap(tt[0][i], tt[1][i]);
        for (int j = 0; j < m; ++j) res2 += t[i][j] != tt[j % 2][i];
        swap(tt[0][i], tt[1][i]);
        cnt += min(res1, res2);
        if (res1 > res2) swap(tt[0][i], tt[1][i]);
      }
      if (cnt < solc) {
        dir = 2;
        solc = cnt;
        sol[0] = tt[0];
        sol[1] = tt[1];
      }
    }
  } while (next_permutation(c, c + 4));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (dir == 1) cout << sol[i % 2][j];
      if (dir == 2) cout << sol[j % 2][i];
    }
    cout << '\n';
  }
}
