#include <bits/stdc++.h>
const bool debug = 0;
int diff(const std::vector<int>& fi, const std::vector<int>& se) {
  assert(fi.size() == se.size());
  int answ = 0;
  for (int i = 0; i < (int)fi.size(); ++i) {
    answ += (fi[i] != se[i]);
  }
  return answ;
}
int solve(std::vector<int> perm, const int nR, const int nC,
          const std::vector<std::vector<int> >& arr,
          std::vector<std::vector<int> >& map) {
  std::vector<int> fi1, fi2, se1, se2;
  for (int i = 0; i < nC; ++i) {
    if (i % 2) {
      fi1.push_back(perm[0]);
      fi2.push_back(perm[1]);
      se1.push_back(perm[2]);
      se2.push_back(perm[3]);
    } else {
      fi1.push_back(perm[1]);
      fi2.push_back(perm[0]);
      se1.push_back(perm[3]);
      se2.push_back(perm[2]);
    }
  }
  int answ = 0;
  for (int r = 0; r < nR; ++r) {
    if (r % 2) {
      int res1 = diff(fi1, arr[r]);
      int res2 = diff(fi2, arr[r]);
      if (res1 < res2) {
        map[r] = fi1;
      } else {
        map[r] = fi2;
      }
      answ += std::min(res1, res2);
    } else {
      int res1 = diff(se1, arr[r]);
      int res2 = diff(se2, arr[r]);
      if (res1 < res2) {
        map[r] = se1;
      } else {
        map[r] = se2;
      }
      answ += std::min(res1, res2);
    }
  }
  return answ;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  std::cout.tie(0);
  std::cerr.tie(0);
  int nR, nC;
  std::string alp = "AGCT";
  while (std::cin >> nR >> nC) {
    std::vector<std::vector<int> > arr(nR, std::vector<int>(nC)),
        temp(nR, std::vector<int>(nC)), best(nR, std::vector<int>(nC));
    std::string s;
    for (int r = 0; r < nR; ++r) {
      std::cin >> s;
      for (int c = 0; c < nC; ++c) {
        arr[r][c] = (int)alp.find(s[c]);
      }
    }
    std::vector<int> perm(4);
    for (int i = 0; i < 4; ++i) {
      perm[i] = i;
    }
    int answ1 = nR * nC + 1;
    do {
      int res1 = solve(perm, nR, nC, arr, temp);
      if (res1 < answ1) {
        answ1 = res1;
        best = temp;
      }
    } while (std::next_permutation(perm.begin(), perm.end()));
    std::vector<std::vector<int> > arr2(nC, std::vector<int>(nR)),
        temp2(nC, std::vector<int>(nR)), best2(nC, std::vector<int>(nR));
    for (int r = 0; r < nR; ++r) {
      for (int c = 0; c < nC; ++c) {
        arr2[c][r] = arr[r][c];
      }
    }
    for (int i = 0; i < 4; ++i) {
      perm[i] = i;
    }
    int answ2 = nR * nC + 1;
    do {
      int res2 = solve(perm, nC, nR, arr2, temp2);
      if (res2 < answ2) {
        answ2 = res2;
        best2 = temp2;
      }
    } while (std::next_permutation(perm.begin(), perm.end()));
    if (answ1 > answ2) {
      for (int r = 0; r < nR; ++r) {
        for (int c = 0; c < nC; ++c) {
          best[r][c] = best2[c][r];
        }
      }
      answ1 = answ2;
    }
    s.assign(nC, '0');
    for (int r = 0; r < nR; ++r) {
      for (int c = 0; c < nC; ++c) {
        s[c] = alp[best[r][c]];
      }
      std::cout << s << "\n";
    }
    if (debug) {
      std::cout << "answ = " << answ1 << std::endl;
    }
  }
  return 0;
}
