#include <bits/stdc++.h>
using namespace std;
const int MAX = 300300;
vector<vector<int> > board;
int h[MAX][4][2], v[MAX][4][2];
map<char, int> dic;
map<int, char> inv;
void init() {
  dic['A'] = 0;
  dic['G'] = 1;
  dic['C'] = 2;
  dic['T'] = 3;
  for (__typeof((dic).begin()) v = (dic).begin(); v != (dic).end(); v++)
    inv[v->second] = v->first;
}
int main() {
  init();
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < int(n); i++) {
    board.push_back(vector<int>());
    for (int j = 0; j < int(m); j++) {
      char c;
      scanf(" %c", &c);
      board[i].push_back(dic[c]);
    }
  }
  for (int i = 0; i < int(n); i++) {
    for (int j = 0; j < int(m); j++) {
      h[i][board[i][j]][j % 2]++;
    }
  }
  for (int j = 0; j < int(m); j++) {
    for (int i = 0; i < int(n); i++) {
      v[j][board[i][j]][i % 2]++;
    }
  }
  int cur[2][2];
  int p[4];
  for (int i = 0; i < int(4); i++) p[i] = i;
  vector<vector<int> > best;
  int bestValue = INFINITY;
  bool horizontal = false;
  do {
    for (int i = 0; i < int(2); i++)
      for (int j = 0; j < int(2); j++) cur[i][j] = p[2 * i + j];
    int value;
    vector<vector<int> > vc;
    value = 0;
    vc.assign(n, vector<int>(2, 0));
    for (int i = 0; i < int(n); i++) {
      int a = cur[i % 2][0], b = cur[i % 2][1];
      int tmp = -1;
      if (h[i][a][0] + h[i][b][1] > h[i][a][1] + h[i][b][0]) {
        tmp = h[i][a][0] + h[i][b][1];
        vc[i][0] = a;
        vc[i][1] = b;
      } else {
        tmp = h[i][a][1] + h[i][b][0];
        vc[i][0] = b;
        vc[i][1] = a;
      }
      value += m - tmp;
    }
    if (value < bestValue) {
      horizontal = true;
      best = vc;
      bestValue = value;
    }
    value = 0;
    vc.assign(m, vector<int>(2, 0));
    for (int i = 0; i < int(m); i++) {
      int a = cur[0][i % 2], b = cur[1][i % 2];
      int tmp = -1;
      if (v[i][a][0] + v[i][b][1] > v[i][a][1] + v[i][b][0]) {
        tmp = v[i][a][0] + v[i][b][1];
        vc[i][0] = a;
        vc[i][1] = b;
      } else {
        tmp = v[i][a][1] + v[i][b][0];
        vc[i][0] = b;
        vc[i][1] = a;
      }
      value += n - tmp;
    }
    if (value < bestValue) {
      horizontal = false;
      best = vc;
      bestValue = value;
    }
  } while (next_permutation(p, p + 4));
  if (horizontal) {
    for (int i = 0; i < int(n); i++) {
      for (int j = 0; j < int(m); j++) {
        board[i][j] = best[i][j % 2];
      }
    }
  } else {
    for (int i = 0; i < int(n); i++) {
      for (int j = 0; j < int(m); j++) {
        board[i][j] = best[j][i % 2];
      }
    }
  }
  for (int i = 0; i < int(n); i++) {
    for (int j = 0; j < int(m); j++) printf("%c", inv[board[i][j]]);
    printf("\n");
  }
}
