#include <bits/stdc++.h>
using namespace std;
const string ACTG = "ACTG";
int N, M;
vector<string> in;
pair<int, string> solve(int k, char a, char b) {
  pair<int, string> A = {0, ""};
  pair<int, string> B = {0, ""};
  char arr[] = {a, b};
  for (int i = 0; i < in[k].size(); i++) {
    A.first += in[k][i] != arr[i % 2];
    A.second += arr[i % 2];
    B.first += in[k][i] != arr[1 - i % 2];
    B.second += arr[1 - i % 2];
  }
  return min(A, B);
}
pair<int, vector<string>> solveRow() {
  pair<int, vector<string>> ret = {1 << 30, vector<string>()};
  for (int a = 0; a < 4; a++)
    for (int b = 0; b < 4; b++)
      if (a != b)
        for (int c = 0; c < 4; c++)
          if (a != c && b != c)
            for (int d = 0; d < 4; d++)
              if (a != d && b != d && c != d) {
                pair<int, vector<string>> cr = {0, vector<string>()};
                for (int i = 0; i < in.size(); i++) {
                  int arr[] = {a, b, c, d};
                  auto x = solve(i, ACTG[arr[0 + 2 * (i % 2)]],
                                 ACTG[arr[1 + 2 * (i % 2)]]);
                  cr.first += x.first;
                  cr.second.push_back(x.second);
                }
                ret = min(ret, cr);
              }
  return ret;
}
vector<string> transpose(vector<string> &x) {
  int n = x.size(), m = x[0].size();
  vector<string> ret;
  for (int i = 0; i < m; i++) {
    string cr = "";
    for (int j = 0; j < n; j++) cr += x[j][i];
    ret.push_back(cr);
  }
  return ret;
}
pair<int, vector<string>> solveCol() {
  in = transpose(in);
  auto ret = solveRow();
  ret.second = transpose(ret.second);
  in = transpose(in);
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> M;
  for (int i = 0; i < N; i++) {
    string x;
    cin >> x;
    in.push_back(x);
  }
  auto ans = min(solveRow(), solveCol());
  for (auto x : ans.second) cout << x << endl;
  return 0;
}
