#include <bits/stdc++.h>
using namespace std;
const int N = 2e5, M = 1e9 + 7;
mt19937_64 rng(std::chrono::system_clock::now().time_since_epoch().count());
int n, m, ans = 1e8;
string c = "ACGT", s[N], bst[N], TEMP[N];
void solve(string perm[2]) {
  int sum = 0;
  for (int i = 0; i < n; i++) {
    int temp = 0, temp1 = 0;
    for (int j = 0; j < m; j++) temp += s[i][j] != perm[i & 1][j & 1];
    swap(perm[i & 1][0], perm[i & 1][1]);
    for (int j = 0; j < m; j++) temp1 += s[i][j] != perm[i & 1][j & 1];
    swap(perm[i & 1][0], perm[i & 1][1]);
    if (temp > temp1) swap(perm[i & 1][0], perm[i & 1][1]);
    for (int j = 0; j < m; j++) TEMP[i][j] = perm[i & 1][j & 1];
    if (temp > temp1) swap(perm[i & 1][0], perm[i & 1][1]);
    sum += min(temp, temp1);
  }
  if (sum < ans) {
    ans = sum;
    for (int i = 0; i < n; i++) bst[i] = TEMP[i];
  }
}
void solve1(string perm[2]) {
  int sum = 0;
  for (int j = 0; j < m; j++) {
    int temp = 0, temp1 = 0;
    for (int i = 0; i < n; i++) temp += s[i][j] != perm[j & 1][i & 1];
    swap(perm[j & 1][0], perm[j & 1][1]);
    for (int i = 0; i < n; i++) temp1 += s[i][j] != perm[j & 1][i & 1];
    swap(perm[j & 1][0], perm[j & 1][1]);
    if (temp > temp1) swap(perm[j & 1][0], perm[j & 1][1]);
    for (int i = 0; i < n; i++) TEMP[i][j] = perm[j & 1][i & 1];
    if (temp > temp1) swap(perm[j & 1][0], perm[j & 1][1]);
    sum += min(temp, temp1);
  }
  if (sum < ans) {
    ans = sum;
    for (int i = 0; i < n; i++) bst[i] = TEMP[i];
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) TEMP[i] += s[i][j];
  do {
    string temp[2];
    temp[0] = c[0];
    temp[0] += c[1];
    temp[1] += c[2];
    temp[1] += c[3];
    solve(temp);
  } while (next_permutation(c.begin(), c.end()));
  do {
    string temp[2];
    temp[0] = c[0];
    temp[0] += c[1];
    temp[1] += c[2];
    temp[1] += c[3];
    solve1(temp);
  } while (next_permutation(c.begin(), c.end()));
  for (int i = 0; i < n; i++, puts(""))
    for (int j = 0; j < m; j++) printf("%c", bst[i][j]);
}
