#include <bits/stdc++.h>
using namespace std;
int n, m, ma, mi, hang[300005][5][5], lie[300005][5][5],
    ans = 0x7fffffff, ansa1, ansb1, ansa2, ansb2, direction;
string s[300005];
char c[5] = {' ', 'A', 'C', 'G', 'T'};
inline void read(int &x) {
  x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return;
}
inline void count_hang(int x, int a, int b) {
  for (int i = 1; i <= m; i++) {
    if ((i & 1) && s[x][i - 1] != c[a]) hang[x][a][b]++;
    if (!(i & 1) && s[x][i - 1] != c[b]) hang[x][a][b]++;
  }
  return;
}
inline void count_lie(int x, int a, int b) {
  for (int i = 1; i <= n; i++) {
    if ((i & 1) && s[i][x - 1] != c[a]) lie[x][a][b]++;
    if (!(i & 1) && s[i][x - 1] != c[b]) lie[x][a][b]++;
  }
}
inline void count_ans() {
  int a, b, num1, num2;
  for (int i = 1; i <= 3; i++)
    for (int j = i + 1; j <= 4; j++) {
      num1 = num2 = 0, a = 0, b = 0;
      for (int k = 1; k <= 4; k++)
        if (k != i && k != j) {
          if (!a)
            a = k;
          else
            b = k;
        }
      for (int x = 1; x <= ma; x++) {
        if (x <= n) {
          if (x & 1)
            num1 += min(hang[x][i][j], hang[x][j][i]);
          else
            num1 += min(hang[x][a][b], hang[x][b][a]);
        }
        if (x <= m) {
          if (x & 1)
            num2 += min(lie[x][i][j], lie[x][j][i]);
          else
            num2 += min(lie[x][a][b], lie[x][b][a]);
        }
      }
      if (num1 < ans) {
        ans = num1;
        direction = 1;
        ansa1 = i;
        ansb1 = j;
        ansa2 = a;
        ansb2 = b;
      }
      if (num2 < ans) {
        ans = num2;
        direction = 0;
        ansa1 = i;
        ansb1 = j;
        ansa2 = a;
        ansb2 = b;
      }
    }
}
inline void print() {
  if (!ans) {
    for (int i = 1; i <= n; i++) cout << s[i] << endl;
    return;
  }
  if (direction) {
    for (int x = 1; x <= n; x++) {
      if (x & 1) {
        if (hang[x][ansa1][ansb1] > hang[x][ansb1][ansa1]) swap(ansa1, ansb1);
        for (int i = 1; i <= m; i++)
          if (i & 1)
            printf("%c", c[ansa1]);
          else
            printf("%c", c[ansb1]);
      } else {
        if (hang[x][ansa2][ansb2] > hang[x][ansb2][ansa2]) swap(ansa2, ansb2);
        for (int i = 1; i <= m; i++)
          if (i & 1)
            printf("%c", c[ansa2]);
          else
            printf("%c", c[ansb2]);
      }
      printf("\n");
    }
  } else {
    for (int x = 1; x <= n; x++) {
      for (int y = 1; y <= m; y++) {
        if (y & 1) {
          if (lie[y][ansa1][ansb1] > lie[y][ansb1][ansa1]) swap(ansa1, ansb1);
          if (x & 1)
            printf("%c", c[ansa1]);
          else
            printf("%c", c[ansb1]);
        } else {
          if (lie[y][ansa2][ansb2] > lie[y][ansb2][ansa2]) swap(ansa2, ansb2);
          if (x & 1)
            printf("%c", c[ansa2]);
          else
            printf("%c", c[ansb2]);
        }
      }
      printf("\n");
    }
  }
  return;
}
int main() {
  read(n);
  read(m);
  for (int i = 1; i <= n; i++) cin >> s[i];
  ma = max(n, m);
  mi = min(n, m);
  for (int x = 1; x <= ma; x++)
    for (int i = 1; i <= 3; i++)
      for (int j = i + 1; j <= 4; j++) {
        if (x <= n) count_hang(x, i, j), count_hang(x, j, i);
        if (x <= m) count_lie(x, i, j), count_lie(x, j, i);
      }
  count_ans();
  print();
  return 0;
}
