#include <bits/stdc++.h>
using namespace std;
int n, m, res = INT_MAX;
vector<char> cur = {'A', 'G', 'C', 'T'};
vector<string> ans;
string l;
int change(string s, char u, char v) {
  int res = 0;
  for (int i = 0; i < (int)s.length(); i++) {
    if (s[i] != u && i % 2 == 0) res++;
    if (s[i] != v && i % 2 == 1) res++;
  }
  return res;
}
int main() {
  cin >> n >> m;
  vector<string> grid(n);
  ans.resize(n);
  for (int i = 0; i < n; i++) cin >> grid[i];
  vector<char> odd, eve;
  for (int rot = 0; rot < 2; rot++) {
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < i; j++) {
        odd = {cur[i], cur[j]};
        eve.clear();
        for (int ii = 0; ii < 4; ii++)
          if (ii != i && ii != j) eve.push_back(cur[ii]);
        int aux = 0;
        if (rot == 0) {
          for (int ii = 0; ii < n; ii++) {
            int u = change(grid[ii], odd[0], odd[1]),
                v = change(grid[ii], eve[0], eve[1]);
            int uu = change(grid[ii], odd[1], odd[0]),
                vv = change(grid[ii], eve[1], eve[0]);
            aux += (ii % 2 ? min(u, uu) : min(v, vv));
          }
        }
        if (rot == 1) {
          for (int ii = 0; ii < m; ii++) {
            l.clear();
            for (int jj = 0; jj < n; jj++) l += grid[jj][ii];
            int u = change(l, odd[0], odd[1]), v = change(l, eve[0], eve[1]);
            int uu = change(l, odd[1], odd[0]), vv = change(l, eve[1], eve[0]);
            aux += (ii % 2 ? min(u, uu) : min(v, vv));
          }
        }
        res = min(res, aux);
      }
    }
  }
  for (int rot = 0; rot < 2; rot++) {
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < i; j++) {
        odd = {cur[i], cur[j]};
        eve.clear();
        for (int ii = 0; ii < 4; ii++)
          if (ii != i && ii != j) eve.push_back(cur[ii]);
        int aux = 0;
        if (rot == 0) {
          for (int ii = 0; ii < n; ii++) {
            int u = change(grid[ii], odd[0], odd[1]),
                v = change(grid[ii], eve[0], eve[1]);
            int uu = change(grid[ii], odd[1], odd[0]),
                vv = change(grid[ii], eve[1], eve[0]);
            aux += (ii % 2 ? min(u, uu) : min(v, vv));
          }
          if (aux == res) {
            for (int ii = 0; ii < n; ii++) {
              vector<char> lar;
              int u = change(grid[ii], odd[0], odd[1]),
                  v = change(grid[ii], eve[0], eve[1]);
              int uu = change(grid[ii], odd[1], odd[0]),
                  vv = change(grid[ii], eve[1], eve[0]);
              if (ii % 2) {
                if (u > uu)
                  lar = {odd[1], odd[0]};
                else
                  lar = {odd[0], odd[1]};
              } else {
                if (v > vv)
                  lar = {eve[1], eve[0]};
                else
                  lar = {eve[0], eve[1]};
              }
              for (int jj = 0; jj < m; jj++) {
                if (jj % 2)
                  ans[ii] += lar[1];
                else
                  ans[ii] += lar[0];
              }
            }
            for (auto ll : ans) cout << ll << endl;
            return 0;
          }
        }
        if (rot == 1) {
          for (int ii = 0; ii < m; ii++) {
            l.clear();
            for (int jj = 0; jj < n; jj++) l += grid[jj][ii];
            int u = change(l, odd[0], odd[1]), v = change(l, eve[0], eve[1]);
            int uu = change(l, odd[1], odd[0]), vv = change(l, eve[1], eve[0]);
            aux += (ii % 2 ? min(u, uu) : min(v, vv));
          }
          if (res == aux) {
            for (int ii = 0; ii < m; ii++) {
              l.clear();
              vector<char> lar;
              for (int jj = 0; jj < n; jj++) l += grid[jj][ii];
              int u = change(l, odd[0], odd[1]), v = change(l, eve[0], eve[1]);
              int uu = change(l, odd[1], odd[0]),
                  vv = change(l, eve[1], eve[0]);
              if (ii % 2) {
                if (u > uu)
                  lar = {odd[1], odd[0]};
                else
                  lar = {odd[0], odd[1]};
              } else {
                if (v > vv)
                  lar = {eve[1], eve[0]};
                else
                  lar = {eve[0], eve[1]};
              }
              for (int jj = 0; jj < n; jj++) {
                if (jj % 2)
                  ans[jj] += lar[1];
                else
                  ans[jj] += lar[0];
              }
            }
            for (auto ll : ans) cout << ll << endl;
            return 0;
          }
        }
      }
    }
  }
  return 0;
}
