#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 17;
int n, m, ans = maxn;
string c[maxn], cer[maxn];
char per[] = "ACGT";
bool w[maxn];
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> c[i], cer[i] = c[i];
  do {
    int cur = 0;
    for (int i = 0; i < n; i++) {
      int c1 = 0, c2 = 0;
      for (int j = 0; j < m; j++) {
        c1 += per[(i & 1) * 2 + (j & 1)] != c[i][j];
        c2 += per[(i & 1) * 2 + !(j & 1)] != c[i][j];
      }
      w[i] = c1 < c2;
      cur += min(c1, c2);
    }
    if (cur < ans) {
      for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++)
          cer[i][j] =
              w[i] ? per[(i & 1) * 2 + (j & 1)] : per[(i & 1) * 2 + !(j & 1)];
      ans = cur;
    }
    cur = 0;
    for (int i = 0; i < m; i++) {
      int c1 = 0, c2 = 0;
      for (int j = 0; j < n; j++) {
        c1 += per[(i & 1) * 2 + (j & 1)] != c[j][i];
        c2 += per[(i & 1) * 2 + !(j & 1)] != c[j][i];
      }
      w[i] = c1 < c2;
      cur += min(c1, c2);
    }
    if (cur < ans) {
      for (int i = 0; i < m; i++)
        for (int j = 0; j < n; j++)
          cer[j][i] =
              w[i] ? per[(i & 1) * 2 + (j & 1)] : per[(i & 1) * 2 + !(j & 1)];
      ans = cur;
    }
  } while (next_permutation(per, per + 4));
  cerr << ans << '\n';
  for (int i = 0; i < n; i++) cout << cer[i] << '\n';
}
