#include <bits/stdc++.h>
using namespace std;
int n, m;
int maxval;
vector<int> agct;
int roc;
int encr[255];
int decr[255];
vector<vector<int> > mat;
int row[300000][4][2];
int col[300000][4][2];
static void determinemax(vector<int> v) {
  int onrow = 0, oncol = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0)
      onrow += max(row[i][v[0]][0] + row[i][v[1]][1],
                   row[i][v[0]][1] + row[i][v[1]][0]);
    else
      onrow += max(row[i][v[2]][0] + row[i][v[3]][1],
                   row[i][v[2]][1] + row[i][v[3]][0]);
  }
  for (int i = 0; i < m; i++) {
    if (i % 2 == 0)
      oncol += max(col[i][v[0]][0] + col[i][v[2]][1],
                   col[i][v[0]][1] + col[i][v[2]][0]);
    else {
      oncol += max(col[i][v[1]][0] + col[i][v[3]][1],
                   col[i][v[1]][1] + col[i][v[3]][0]);
    }
  }
  if (onrow > maxval) {
    maxval = onrow;
    agct = v;
    roc = 'r';
  }
  if (oncol > maxval) {
    maxval = oncol;
    agct = v;
    roc = 'c';
  }
  if (next_permutation(v.begin(), v.end())) determinemax(v);
  return;
}
int main() {
  encr['A'] = 0;
  encr['C'] = 1;
  encr['G'] = 2;
  encr['T'] = 3;
  decr[0] = 'A';
  decr[1] = 'C';
  decr[2] = 'G';
  decr[3] = 'T';
  char ch;
  cin >> n >> m;
  mat.resize(n, vector<int>(m));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> ch;
      ch = encr[ch];
      mat[i][j] = ch;
      row[i][ch][j % 2]++;
      col[j][ch][i % 2]++;
    }
  }
  vector<int> v = {0, 1, 2, 3};
  determinemax(v);
  v = agct;
  if (roc == 'r') {
    for (int i = 0; i < n; i++) {
      if (i % 2 == 0) {
        if (row[i][v[0]][0] + row[i][v[1]][1] >
            row[i][v[0]][1] + row[i][v[1]][0]) {
          for (int j = 0; j < m; j++) {
            mat[i][j] = v[j & 1];
          }
        } else {
          for (int j = 0; j < m; j++) {
            mat[i][j] = v[!(j & 1)];
          }
        }
      } else {
        if (row[i][v[2]][0] + row[i][v[3]][1] >
            row[i][v[2]][1] + row[i][v[3]][0]) {
          for (int j = 0; j < m; j++) {
            mat[i][j] = v[2 + (j & 1)];
          }
        } else {
          for (int j = 0; j < m; j++) {
            mat[i][j] = v[2 + !(j & 1)];
          }
        }
      }
    }
  }
  if (roc == 'c') {
    for (int i = 0; i < m; i++) {
      if (i % 2 == 0) {
        if (col[i][v[0]][0] + col[i][v[2]][1] >
            col[i][v[0]][1] + col[i][v[2]][0])
          for (int j = 0; j < n; j++) mat[j][i] = v[(j & 1) << 1];
        else
          for (int j = 0; j < n; j++) mat[j][i] = v[!(j & 1) << 1];
      } else {
        if (col[i][v[1]][0] + col[i][v[3]][1] >
            col[i][v[1]][1] + col[i][v[3]][0])
          for (int j = 0; j < n; j++) mat[j][i] = v[1 + (((j & 1)) << 1)];
        else
          for (int j = 0; j < n; j++) mat[j][i] = v[1 + ((!(j & 1)) << 1)];
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cout << (char)decr[mat[i][j]];
    }
    cout << '\n';
  }
}
