#include <bits/stdc++.h>
using namespace std;
template <class T>
using VV = vector<vector<T>>;
template <class T>
inline T SMIN(T& a, const T b) {
  return a = (a > b) ? b : a;
}
template <class T>
inline T SMAX(T& a, const T b) {
  return a = (a < b) ? b : a;
}
template <class Iter>
void dumpc(Iter begin, Iter end) {
  if (false) {
    for (; begin != end; ++begin) {
      cerr << *begin << ',';
    }
    cerr << endl;
  }
}
vector<string> A;
int N, M;
char P[4] = {'A', 'C', 'G', 'T'};
const int Inf = 1e8;
vector<string> ans;
int f(VV<char> cs, vector<string>& A) {
  ans.clear();
  int cost = 0, N = int((A).size()), M = int((A[0]).size());
  for (int i = 0; i < (N); ++i) {
    int a = Inf, fla = 0;
    for (int fl = 0; fl < (2); ++fl) {
      int x = 0;
      for (int j = 0; j < (M); ++j) x += A[i][j] != cs[i % 2][(j % 2) ^ fl];
      if (x < a) a = x, fla = fl;
    }
    string row(M, '?');
    for (int j = 0; j < (M); ++j) row[j] = cs[i % 2][(j % 2) ^ fla];
    ans.push_back(row);
    cost += a;
  }
  assert(int((ans).size()) == N && int((ans[0]).size()) == M);
  return cost;
}
vector<string> turn(vector<string>& X) {
  int N = int((X).size()), M = int((X[0]).size());
  vector<string> res(M, string(N, '?'));
  for (int i = 0; i < (N); ++i)
    for (int j = 0; j < (M); ++j) res[j][i] = X[i][j];
  assert(int((res).size()) == M && int((res[0]).size()) == N);
  return res;
}
void solve() {
  int cost = Inf;
  vector<string> res;
  for (int i = 0; i < (4); ++i)
    for (int j = (i + 1); j < (4); ++j) {
      VV<char> cs(2);
      cs[0] = {P[i], P[j]};
      for (int k = 0; k < (4); ++k)
        if (k != i && k != j) cs[1].push_back(P[k]);
      int cost1 = f(cs, A);
      if (cost1 < cost) res = ans, cost = cost1;
      vector<string> B = turn(A);
      int cost2 = f(cs, B);
      if (cost2 < cost) res = turn(ans), cost = cost2;
      if (false) {
        cerr << "cost"
             << " = " << (cost) << ", "
             << "cost1"
             << " = " << (cost1) << ", "
             << "cost2"
             << " = " << (cost2) << endl;
      };
    }
  if (false) {
    cerr << "cost"
         << " = " << (cost) << endl;
  };
  assert(int((res).size()) == N && int((res[0]).size()) == M);
  for (auto& s : res) {
    fprintf(stdout, "%s", s.c_str()), putchar('\n');
    ;
  }
}
int pos1(int i, int j) {
  int x = i % 2 * 2;
  x += j % 2;
  assert(0 <= x && x < 4);
  return x;
}
int f1() {
  int res = 0;
  for (int i = 0; i < (N); ++i)
    for (int j = 0; j < (M); ++j) {
      int x = pos1(i, j);
      res += (P[x] != A[i][j]);
    }
  return res;
}
int pos2(int i, int j) {
  int x = j % 4;
  if (i % 2 == 1) {
    x = (x + 2) % 4;
  }
  assert(0 <= x && x < 4);
  return x;
}
int f2() {
  int res = 0;
  for (int i = 0; i < (N); ++i)
    for (int j = 0; j < (M); ++j) {
      res += P[pos2(i, j)] != A[i][j];
    }
  return res;
}
void solve_wrong() {
  int cost = Inf;
  int p = -1;
  vector<char> perm;
  do {
    int a = f1(), b = f2();
    if (a < cost) p = 0, perm = vector<char>(P, P + 4), cost = a;
    if (b < cost) p = 1, perm = vector<char>(P, P + 4), cost = b;
    ;
  } while (next_permutation(P, P + 4));
  if (false) {
    cerr << "cost"
         << " = " << (cost) << endl;
  };
  assert(cost != Inf);
  vector<string> res(N, string(M, '?'));
  if (p == 0) {
    int c = 0;
    for (int i = 0; i < (N); ++i)
      for (int j = 0; j < (M); ++j) {
        res[i][j] = perm[pos1(i, j)];
        c += (A[i][j] != perm[pos1(i, j)]);
      }
    assert(c == cost);
  } else {
    int c = 0;
    for (int i = 0; i < (N); ++i)
      for (int j = 0; j < (M); ++j) {
        res[i][j] = perm[pos2(i, j)];
        c += (A[i][j] != perm[pos2(i, j)]);
      }
    assert(c == cost);
  }
  for (auto& s : res) {
    fprintf(stdout, "%s", s.c_str()), putchar('\n');
    ;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(12) << fixed;
  cin >> N >> M;
  for (int i = 0; i < (N); ++i) {
    string s;
    cin >> s;
    A.push_back(s);
  }
  solve();
  return 0;
}
