#include <bits/stdc++.h>
using namespace std;
string s[300009];
int n, m;
int mn = 1e9;
char al[3] = {'C', 'G', 'T'};
int la, aa, oa;
void proc(int l, int aaa, int o) {
  int s1 = n, s2 = m;
  if (l) swap(s1, s2);
  string si1 = "A", si2 = "";
  for (int i = 0; i < 3; i++) {
    if (i == aaa)
      si1 += al[i];
    else
      si2 += al[i];
  }
  int mnn = 0;
  for (int i = 0; i < s1; i++) {
    int cmn;
    string a;
    if (i % 2 == o)
      a = si1;
    else
      a = si2;
    int cc = 0;
    for (int j = 0; j < s2; j++) {
      int k = j;
      if (l) swap(i, j);
      if (s[i][j] != a[k % 2]) cc++;
      if (l) swap(i, j);
    }
    swap(a[0], a[1]);
    cmn = cc;
    cc = 0;
    for (int j = 0; j < s2; j++) {
      int k = j;
      if (l) swap(i, j);
      if (s[i][j] != a[k % 2]) cc++;
      if (l) swap(i, j);
    }
    cmn = min(cmn, cc);
    mnn += cmn;
  }
  mn = min(mn, mnn);
  if (mn == mnn) {
    la = l;
    aa = aaa;
    oa = o;
  }
}
string ans[300009];
void fna(int l, int aaa, int o) {
  int s1 = n, s2 = m;
  if (l) swap(s1, s2);
  string si1 = "A", si2 = "";
  for (int i = 0; i < 3; i++) {
    if (i == aaa)
      si1 += al[i];
    else
      si2 += al[i];
  }
  int mnn = 0;
  for (int i = 0; i < s1; i++) {
    int cmn;
    string a;
    if (i % 2 == o)
      a = si1;
    else
      a = si2;
    int cc = 0;
    for (int j = 0; j < s2; j++) {
      int k = j;
      if (l) swap(i, j);
      if (s[i][j] != a[k % 2]) cc++;
      if (l) swap(i, j);
    }
    swap(a[0], a[1]);
    cmn = cc;
    cc = 0;
    for (int j = 0; j < s2; j++) {
      int k = j;
      if (l) swap(i, j);
      if (s[i][j] != a[k % 2]) cc++;
      if (l) swap(i, j);
    }
    cmn = min(cmn, cc);
    if (cmn != cc) swap(a[0], a[1]);
    for (int j = 0; j < s2; j++) {
      int k = j;
      if (l) swap(i, j);
      ans[i] += a[k % 2];
      if (l) swap(i, j);
    }
  }
  mn = min(mn, mnn);
  if (mn == mnn) {
    la = l;
    aa = aaa;
    oa = o;
  }
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> s[i];
  int cur = 0;
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 3; j++) {
      for (int k = 0; k < 2; k++) proc(i, j, k);
    }
  }
  fna(la, aa, oa);
  for (int i = 0; i < n; i++) cout << ans[i] << "\n";
}
