#include <bits/stdc++.h>
using namespace std;
vector<string> v;
vector<vector<string> > cases = {{"AT", "CG"}, {"AC", "TG"}, {"AG", "CT"}};
vector<string> tmp;
vector<string> best;
int min_score = 1000000000;
void print(vector<string> &m) {
  for (int i = 0; i < m.size(); i++) {
    cout << m[i] << endl;
  }
}
vector<string> transpose(vector<string> &m) {
  vector<string> res;
  res.resize(m[0].size());
  for (int i = 0; i < m.size(); i++) {
    for (int j = 0; j < m[0].size(); j++) {
      res[j] += m[i][j];
    }
  }
  return res;
}
int cmp(string x, string y) {
  int res = 0;
  for (int i = 0; i < x.size(); i++) {
    if (x[i] != y[i]) res++;
  }
  return res;
}
vector<string> build_matrix(vector<string> tab) {
  vector<string> res;
  for (int i = 0; i < v.size(); i++) {
    string str1 = "";
    string str2 = "";
    for (int j = 0; j < v[0].size(); j++) str1 += tab[i % 2][j % 2];
    for (int j = 0; j < v[0].size(); j++) str2 += tab[i % 2][(j + 1) % 2];
    int score1 = cmp(str1, v[i]), score2 = cmp(str2, v[i]);
    res.push_back(score1 < score2 ? str1 : str2);
  }
  return res;
}
int cmp(vector<string> &x, vector<string> &y) {
  int res = 0;
  for (int i = 0; i < x.size(); i++) res += cmp(x[i], y[i]);
  return res;
}
void check(vector<string> tab, bool trans = false) {
  int score;
  tmp = build_matrix(tab);
  score = cmp(v, tmp);
  if (trans) tmp = transpose(tmp);
  if (score < min_score) {
    best = tmp;
    min_score = score;
  }
}
int main() {
  int a, b;
  cin >> a >> b;
  string s;
  for (int i = 0; i < a; i++) {
    cin >> s;
    v.push_back(s);
  }
  for (auto tab : cases) {
    check(tab);
    swap(tab[0], tab[1]);
    check(tab);
    v = transpose(v);
    check(tab, true);
    swap(tab[0], tab[1]);
    check(tab, true);
    v = transpose(v);
  }
  print(best);
}
