#include <bits/stdc++.h>
const int inf = 2e9;
using namespace std;
long long MOD = 1000000007;
typedef struct {
  int a, b, c;
} iii;
void mosA(vector<int> a) {
  for (int i = 0; i < a.size(); i++) printf("%d ", a[i]);
  printf("\n");
}
void mosP(vector<pair<int, int> > a) {
  for (int i = 0; i < a.size(); i++) printf("%d %d\n", a[i].first, a[i].second);
  printf("\n");
}
bool ord(pair<int, int> a, pair<int, int> b) { return b.second < a.second; }
long long ans = 0;
int k, a, b, minimo, ver, t, p, n, m;
string S[300005];
string SOL[300005];
char** x;
pair<int, int> comp_col(int j, char* l) {
  int ans1 = 0, ans2 = 0;
  for (int i = 0; i < (n); i++)
    if (S[i][j] == l[i % 2]) ans1++;
  for (int i = 0; i < (n); i++)
    if (S[i][j] == l[(i + 1) % 2]) ans2++;
  if (ans1 > ans2) return {ans1, 1};
  return {ans2, 2};
}
pair<int, int> comp_fil(int i, char* l) {
  int ans1 = 0, ans2 = 0;
  for (int j = 0; j < (m); j++)
    if (S[i][j] == l[j % 2]) ans1++;
  for (int j = 0; j < (m); j++)
    if (S[i][j] == l[(j + 1) % 2]) ans2++;
  if (ans1 > ans2) return {ans1, 1};
  return {ans2, 2};
}
vector<int> comp_total_fil(char** p) {
  int tot = 0;
  vector<int> v;
  v.push_back(1);
  v.push_back(0);
  for (int i = 0; i < (n); i++) {
    pair<int, int> aux = comp_fil(i, p[i % 2]);
    tot += aux.first;
    v.push_back(aux.second);
  }
  v[1] = tot;
  return v;
}
vector<int> comp_total_col(char** p) {
  int tot = 0;
  vector<int> v;
  v.push_back(2);
  v.push_back(0);
  for (int i = 0; i < (m); i++) {
    pair<int, int> aux = comp_col(i, p[i % 2]);
    tot += aux.first;
    v.push_back(aux.second);
  }
  v[1] = tot;
  return v;
}
void crear(vector<int> v) {
  int l = v.size();
  vector<int> f;
  for (int i = 2; i < l; i++) f.push_back(v[i]);
  if (v[0] == 1) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++)
        if (f[i] == 1)
          SOL[i] += x[i % 2][j % 2];
        else
          SOL[i] += x[i % 2][(j + 1) % 2];
  }
  if (v[0] == 2) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++)
        if (f[j] == 1)
          SOL[i] += x[j % 2][i % 2];
        else
          SOL[i] += x[j % 2][(i + 1) % 2];
  }
}
int main() {
  scanf("%d%d", &n, &m);
  int maximo = 0;
  vector<int> v1, v2, v;
  for (int i = 0; i < (n); i++) cin >> S[i];
  string c = "AGCT";
  for (int i = 0; i < 24; i++) {
    next_permutation(c.begin(), c.end());
    char** p = (char**)malloc(sizeof(char*) * 2);
    p[0] = (char*)malloc(sizeof(char) * 3);
    p[1] = (char*)malloc(sizeof(char) * 3);
    p[0][0] = c[0];
    p[0][1] = c[1];
    p[1][0] = c[2];
    p[1][1] = c[3];
    v1 = comp_total_fil(p);
    v2 = comp_total_col(p);
    if (v1[1] > maximo) {
      maximo = v1[1];
      v = v1;
      x = p;
    }
    if (v2[1] > maximo) {
      maximo = v2[1];
      v = v2;
      x = p;
    }
  }
  crear(v);
  for (int i = 0; i < (n); i++) cout << SOL[i] << endl;
}
