#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int grand(int x) { return uniform_int_distribution<int>(0, x - 1)(rng); }
const int maxn = 3e5 + 7;
const int inf = 1e9 + 7;
const long long mod = 1e9 + 7;
long long gcd(long long x, long long y) {
  if (x < y) return gcd(y, x);
  if (y == 0) return x;
  return gcd(y, x % y);
}
string A[maxn];
string B[maxn];
string best[maxn];
char ch[] = {'A', 'T', 'G', 'C'};
int main() {
  {
    ios ::sync_with_stdio(false);
    cin.tie(0);
  };
  int n, m;
  cin >> n >> m;
  for (int j = 0; j < n; j++) {
    cin >> A[j];
    B[j] = A[j];
  }
  string blk[2];
  blk[0] = "  ";
  blk[1] = "  ";
  int bsc = inf;
  for (int x = 0; x < 4; x++) {
    for (int y = 0; y < 4; y++) {
      for (int z = 0; z < 4; z++) {
        for (int w = 0; w < 4; w++) {
          if (x == y || x == z || x == w || y == z || y == w || z == w)
            continue;
          blk[0][0] = ch[x];
          blk[0][1] = ch[y];
          blk[1][0] = ch[z];
          blk[1][1] = ch[w];
          int sc = 0;
          for (int k = 0; k < m; k++) {
            B[0][k] = blk[0][k % 2];
            B[1][k] = blk[1][k % 2];
            sc += B[0][k] != A[0][k];
            sc += B[1][k] != A[1][k];
          }
          for (int j = 2; j < n; j++) {
            int sc0 = 0, sc1 = 0;
            for (int k = 0; k < m; k++) {
              sc0 += B[j % 2][(k & 1)] != A[j][k];
              sc1 += B[j % 2][(k & 1) ^ 1] != A[j][k];
            }
            if (sc0 < sc1) {
              for (int k = 0; k < m; k++) {
                B[j][k] = B[j % 2][k & 1];
                sc += B[j][k] != A[j][k];
              }
            } else {
              for (int k = 0; k < m; k++) {
                B[j][k] = B[j % 2][(k & 1) ^ 1];
                sc += B[j][k] != A[j][k];
              }
            }
          }
          if (sc < bsc) {
            bsc = sc;
            for (int j = 0; j < n; j++) {
              best[j] = B[j];
            }
          }
          sc = 0;
          for (int j = 0; j < n; j++) {
            B[j][0] = blk[j % 2][0];
            B[j][1] = blk[j % 2][1];
            sc += B[j][0] != A[j][0];
            sc += B[j][1] != A[j][1];
          }
          for (int k = 2; k < m; k++) {
            int sc0 = 0, sc1 = 0;
            for (int j = 0; j < n; j++) {
              sc0 += B[j & 1][(k & 1)] != A[j][k];
              sc1 += B[(j & 1) ^ 1][(k & 1)] != A[j][k];
            }
            if (sc0 < sc1) {
              for (int j = 0; j < n; j++) {
                B[j][k] = B[(j & 1)][k & 1];
                sc += B[j][k] != A[j][k];
              }
            } else {
              for (int j = 0; j < n; j++) {
                B[j][k] = B[(j & 1) ^ 1][(k & 1)];
                sc += B[j][k] != A[j][k];
              }
            }
          }
          if (sc < bsc) {
            bsc = sc;
            for (int j = 0; j < n; j++) {
              best[j] = B[j];
            }
          }
        }
      }
    }
  }
  for (int j = 0; j < n; j++) {
    cout << best[j] << "\n";
  }
}
