#include <bits/stdc++.h>
using namespace std;
vector<string> g;
int check(string &a, string &b) {
  int ret = 0, ret2 = 0;
  for (int i = 0; i < a.size(); i++) {
    if (a[i] != b[i & 1]) ret++;
    if (a[i] != b[!(i & 1)]) ret2++;
  }
  return min(ret, ret2);
}
int solve(string a, string b) {
  int ret = 0;
  for (int i = 0; i < g.size(); i++) {
    if (i % 2 == 0)
      ret += check(g[i], a);
    else
      ret += check(g[i], b);
  }
  return ret;
}
void transpose() {
  vector<string> ret(g[0].size());
  for (int i = 0; i < g[0].size(); i++) {
    ret[i] = "";
    for (int j = 0; j < g.size(); j++) ret[i] += g[j][i];
  }
  g = ret;
}
string check1(string &a, string &b) {
  int ret = 0, ret2 = 0;
  string F = "";
  string S = "";
  for (int i = 0; i < a.size(); i++) {
    F += b[i & 1];
    S += b[!(i & 1)];
    if (a[i] != b[i & 1]) ret++;
    if (a[i] != b[!(i & 1)]) ret2++;
  }
  if (ret < ret2) return F;
  return S;
}
vector<string> build(string a, string b) {
  vector<string> ret;
  for (int i = 0; i < g.size(); i++) {
    if (i % 2 == 0)
      ret.push_back(check1(g[i], a));
    else
      ret.push_back(check1(g[i], b));
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  g.resize(n);
  for (int i = 0; i < n; i++) cin >> g[i];
  string A = "AGCT";
  sort(A.begin(), A.end());
  int ans = n * m;
  string T;
  bool flag = 0;
  do {
    int x = solve(A.substr(0, 2), A.substr(2));
    if (ans > x) ans = x, T = A, flag = 0;
  } while (next_permutation(A.begin(), A.end()));
  sort(A.begin(), A.end());
  transpose();
  do {
    int x = solve(A.substr(0, 2), A.substr(2));
    if (ans > x) ans = x, T = A, flag = 1;
  } while (next_permutation(A.begin(), A.end()));
  if (!flag) transpose();
  vector<string> g2 = build(T.substr(0, 2), T.substr(2));
  g = g2;
  if (flag) transpose();
  for (int i = 0; i < n; i++, cout << '\n')
    for (int j = 0; j < m; j++) cout << g[i][j];
  return 0;
}
