#include <bits/stdc++.h>
using namespace std;
long long int lo = pow(10, 16);
vector<string> res;
vector<string> trans(vector<string> &v, long long int n, long long int m) {
  vector<string> g(m);
  for (long long int j = 0; j < m; j++)
    for (long long int i = 0; i < n; i++) g[j].push_back(v[i][j]);
  return g;
}
void func(vector<char> per, vector<string> &v, long long int n, long long int m,
          long long int f) {
  vector<string> temp = v;
  temp[0][0] = per[0], temp[0][1] = per[1], temp[1][0] = per[2],
  temp[1][1] = per[3];
  long long int sum = 0;
  for (long long int j = 0; j < m; j++) {
    long long int val1 = 0, val2 = 0;
    char a, b;
    if (j % 2 == 0)
      a = per[0], b = per[3];
    else
      a = per[1], b = per[2];
    for (long long int i = 0; i < n; i++) {
      if (i % 2 == 0 && v[i][j] != a) val1++;
      if (i % 2 == 1 && v[i][j] != b) val1++;
    }
    for (long long int i = 0; i < n; i++) {
      if (i % 2 == 1 && v[i][j] != a) val2++;
      if (i % 2 == 0 && v[i][j] != b) val2++;
    }
    if (val1 <= val2 || j < 2) {
      for (long long int i = 0; i < n; i++) temp[i][j] = (i % 2 == 0 ? a : b);
      sum += val1;
    } else {
      for (long long int i = 0; i < n; i++) temp[i][j] = (i % 2 == 0 ? b : a);
      sum += val2;
    }
  }
  if (sum < lo) {
    lo = sum;
    if (f) temp = trans(temp, n, m);
    res = temp;
  }
}
void solve() {
  long long int n, m;
  cin >> n >> m;
  vector<string> v(n);
  for (long long int i = 0; i < n; i++) cin >> v[i];
  vector<string> vr = trans(v, n, m);
  vector<char> per(4);
  per[0] = 'A', per[1] = 'C', per[2] = 'G', per[3] = 'T';
  do {
    func(per, v, n, m, 0);
    func(per, vr, m, n, 1);
  } while (next_permutation(per.begin(), per.end()));
  for (long long int i = 0; i < n; i++) cout << res[i] << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int qc = 1;
  for (long long int i = 1; i <= qc; i++) solve();
}
