#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 10;
const long long inf = 2e18;
const long long mod = 1e9 + 7;
const long long eps = 1e-9;
const char spc = 29;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
using namespace std;
vector<vector<char>> a;
vector<vector<char>> acp;
long long n, m;
void inverse() {
  vector<vector<char>> buf1(m, vector<char>(n, '#'));
  vector<vector<char>> buf2(m, vector<char>(n, '#'));
  for (long long i = 0; i < m; ++i)
    for (long long j = 0; j < n; ++j) buf1[i][j] = acp[j][i];
  for (long long i = 0; i < m; ++i)
    for (long long j = 0; j < n; ++j) buf2[i][j] = a[j][i];
  acp.clear();
  a.clear();
  acp.resize(m, vector<char>(n, '#'));
  a.resize(m, vector<char>(n, '#'));
  swap(n, m);
  for (long long i = 0; i < n; ++i)
    for (long long j = 0; j < m; ++j) acp[i][j] = buf1[i][j];
  for (long long i = 0; i < n; ++i)
    for (long long j = 0; j < m; ++j) a[i][j] = buf2[i][j];
}
vector<char> construct(string s) {
  vector<char> res;
  for (long long i = 0; i + 1 < m; i += 2) {
    res.push_back(s[0]);
    res.push_back(s[1]);
  }
  if (m & 1) res.push_back(s[0]);
  return move(res);
}
long long nonmat(vector<char> &s1, vector<char> &s2) {
  long long res = 0;
  for (long long i = 0; i < m; ++i)
    if (s1[i] != s2[i]) ++res;
  return res;
}
long long calc(string &p) {
  long long res = 0;
  long long cur = 0;
  vector<char> strs[4];
  string h1 = p.substr(0, 2);
  string h2 = p.substr(2, 2);
  strs[0] = construct(h1);
  swap(h1[0], h1[1]);
  strs[1] = construct(h1);
  strs[2] = construct(h2);
  swap(h2[0], h2[1]);
  strs[3] = construct(h2);
  for (long long i = 0; i < n; ++i, cur += 2) {
    if (cur >= 4) cur -= 4;
    long long val1 = nonmat(acp[i], strs[cur]);
    long long val2 = nonmat(acp[i], strs[cur + 1]);
    if (val1 < val2) {
      copy((strs[cur]).begin(), (strs[cur]).end(), a[i].begin());
      res += val1;
    } else {
      copy((strs[cur + 1]).begin(), (strs[cur + 1]).end(), a[i].begin());
      res += val2;
    }
  }
  return res;
}
long long solve() {
  string p = "ACGT";
  long long bst = inf;
  string bstp = p;
  while (true) {
    long long nval = calc(p);
    if (nval < bst) {
      bst = nval;
      bstp = p;
    }
    if (!next_permutation(p.begin(), p.end())) break;
  }
  calc(bstp);
  return bst;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  a.resize(n, vector<char>(m, '#'));
  acp.resize(n, vector<char>(m, '#'));
  for (long long i = 0; i < n; ++i)
    for (long long j = 0; j < m; ++j) {
      cin >> a[i][j];
      acp[i][j] = a[i][j];
    }
  long long res1 = solve();
  inverse();
  long long res2 = solve();
  if (res1 < res2) {
    inverse();
    solve();
    for (long long i = 0; i < n; ++i) {
      for (long long j = 0; j < m; ++j) cout << a[i][j];
      cout << "\n";
    }
    return 0;
  }
  inverse();
  for (long long i = 0; i < n; ++i) {
    for (long long j = 0; j < m; ++j) cout << a[i][j];
    cout << "\n";
  }
}
