#include <bits/stdc++.h>
using namespace std;
const string b = "AGCT";
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<string> a(n);
  for (auto &x : a) cin >> x;
  vector<vector<int> > dp(n, vector<int>(16));
  for (int i = 0; i < n; i++) {
    for (int x = 0; x < 16; x++) {
      if (x / 4 == x % 4) {
        dp[i][x] = -1;
        continue;
      }
      for (int j = 0; j < m; j++) {
        if (j % 2 == 0) {
          if (a[i][j] != b[x / 4]) dp[i][x]++;
        } else if (a[i][j] != b[x % 4])
          dp[i][x]++;
      }
    }
  }
  vector<vector<int> > last(n, vector<int>(16));
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < 16; j++) {
      if (j / 4 == j % 4) continue;
      int add = INT_MAX, pos;
      for (int k = 0; k < 16; k++) {
        if (k / 4 == k % 4) continue;
        if (j / 4 == k / 4 or j / 4 == k % 4 or j % 4 == k / 4 or
            j % 4 == k % 4)
          continue;
        if (dp[i - 1][k] < add) {
          add = dp[i - 1][k];
          pos = k;
        }
      }
      last[i][j] = pos;
      dp[i][j] += add;
    }
  }
  vector<vector<int> > dp2(m, vector<int>(16));
  for (int i = 0; i < m; i++) {
    for (int x = 0; x < 16; x++) {
      if (x / 4 == x % 4) {
        dp2[i][x] = -1;
        continue;
      }
      for (int j = 0; j < n; j++) {
        if (j % 2 == 0) {
          if (a[j][i] != b[x / 4]) dp2[i][x]++;
        } else if (a[j][i] != b[x % 4])
          dp2[i][x]++;
      }
    }
  }
  vector<vector<int> > last2(m, vector<int>(16));
  for (int i = 1; i < m; i++) {
    for (int j = 0; j < 16; j++) {
      if (j / 4 == j % 4) continue;
      int add = INT_MAX, pos;
      for (int k = 0; k < 16; k++) {
        if (k / 4 == k % 4) continue;
        if (j / 4 == k / 4 or j / 4 == k % 4 or j % 4 == k / 4 or
            j % 4 == k % 4)
          continue;
        if (dp2[i - 1][k] < add) {
          add = dp2[i - 1][k];
          pos = k;
        }
      }
      last2[i][j] = pos;
      dp2[i][j] += add;
    }
  }
  int colmin = 1, rowmin = 1;
  for (int i = 0; i < 16; i++) {
    if (i / 4 == i % 4) continue;
    if (dp[n - 1][i] < dp[n - 1][rowmin]) rowmin = i;
    if (dp2[m - 1][i] < dp2[m - 1][colmin]) colmin = i;
  }
  if (dp[n - 1][rowmin] < dp2[m - 1][colmin]) {
    vector<int> ans(n);
    for (int i = n - 1; i >= 0; i--) {
      ans[i] = rowmin;
      rowmin = last[i][rowmin];
    }
    for (auto &x : ans) {
      for (int i = 0; i < m; i++) {
        if (i % 2 == 0)
          cout << b[x / 4];
        else
          cout << b[x % 4];
      }
      cout << endl;
    }
  } else {
    vector<int> ans(m);
    for (int i = m - 1; i >= 0; i--) {
      ans[i] = colmin;
      colmin = last2[i][colmin];
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (i % 2 == 0)
          cout << b[ans[j] / 4];
        else
          cout << b[ans[j] % 4];
      }
      cout << endl;
    }
  }
}
