#include <bits/stdc++.h>
using namespace std;
const int N = 200500;
int n, m;
string a[N];
vector<vector<char>> t;
int doit(string s) {
  int diff = 0;
  for (int i = 0, qwerty = n; i < qwerty; i++) {
    char c0, c1;
    if (i % 2 == 0)
      c0 = s[0], c1 = s[1];
    else
      c0 = s[2], c1 = s[3];
    int r0 = 0;
    for (int j = 0; j < m; j += 2) {
      t[i][j] = c0;
      r0 += c0 != a[i][j];
      if (j + 1 < m) t[i][j + 1] = c1, r0 += c1 != a[i][j + 1];
    }
    int r1 = 0;
    swap(c0, c1);
    for (int j = 0; j < m; j += 2) {
      t[i][j] = c0;
      r1 += c0 != a[i][j];
      if (j + 1 < m) t[i][j + 1] = c1, r1 += c1 != a[i][j + 1];
    }
    if (r0 < r1) {
      swap(c0, c1);
      for (int j = 0; j < m; j += 2) {
        t[i][j] = c0;
        if (j + 1 < m) t[i][j + 1] = c1;
      }
    }
    diff += min(r0, r1);
  }
  return diff;
}
int doit2(string s) {
  int diff = 0;
  for (int j = 0, qwerty = m; j < qwerty; j++) {
    char c0, c1;
    if (j % 2 == 0)
      c0 = s[0], c1 = s[1];
    else
      c0 = s[2], c1 = s[3];
    int r0 = 0;
    for (int i = 0; i < n; i += 2) {
      t[i][j] = c0;
      r0 += c0 != a[i][j];
      if (i + 1 < n) t[i + 1][j] = c1, r0 += c1 != a[i + 1][j];
    }
    int r1 = 0;
    swap(c0, c1);
    for (int i = 0; i < n; i += 2) {
      t[i][j] = c0;
      r1 += c0 != a[i][j];
      if (i + 1 < n) t[i + 1][j] = c1, r1 += c1 != a[i + 1][j];
    }
    if (r0 < r1) {
      swap(c0, c1);
      for (int i = 0; i < n; i += 2) {
        t[i][j] = c0;
        if (i + 1 < n) t[i + 1][j] = c1;
      }
    }
    diff += min(r0, r1);
  }
  return diff;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s = "ACGT", ans[2];
  cin >> n >> m;
  for (int i = 0, qwerty = n; i < qwerty; i++) cin >> a[i];
  t.resize(n + 2);
  for (int i = 0, qwerty = n + 2; i < qwerty; i++) t[i].resize(m + 2);
  int r[2] = {n * m, n * m};
  do {
    int w = doit(s);
    if (w < r[0]) r[0] = w, ans[0] = s;
    w = doit2(s);
    if (w < r[1]) r[1] = w, ans[1] = s;
  } while (next_permutation((s).begin(), (s).end()));
  if (r[0] < r[1])
    doit(ans[0]);
  else
    doit2(ans[1]);
  for (int i = 0, qwerty = n; i < qwerty; i++) {
    for (int j = 0, qwerty = m; j < qwerty; j++) cout << t[i][j];
    cout << "\n";
  }
}
