#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<vector<char>> mx;
vector<char> l = {'A', 'G', 'C', 'T'};
int top = 1e9, f1, s1, f2, s2;
vector<int> r;
vector<int> p;
void ARTHAS() {
  p.resize(m);
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      int x, y;
      for (int k = 0; k < 4; k++) {
        if (k != i && k != j) {
          x = k;
          break;
        }
      }
      for (int k = 0; k < 4; k++) {
        if (k != i && k != j && k != x) {
          y = k;
          break;
        }
      }
      if (i != j) {
        int all = 0;
        for (int q = 0; q < m; q++) {
          int ans1 = 0;
          int ans2 = 0;
          if ((q + 1) % 2 == 1) {
            for (int w = 0; w < n; w++) {
              if ((w + 1) % 2 == 1 && mx[w][q] != l[x]) ans1++;
              if ((w + 1) % 2 == 0 && mx[w][q] != l[y]) ans1++;
            }
            for (int w = 0; w < n; w++) {
              if ((w + 1) % 2 == 1 && mx[w][q] != l[y]) ans2++;
              if ((w + 1) % 2 == 0 && mx[w][q] != l[x]) ans2++;
            }
          } else {
            for (int w = 0; w < n; w++) {
              if ((w + 1) % 2 == 1 && mx[w][q] != l[i]) ans1++;
              if ((w + 1) % 2 == 0 && mx[w][q] != l[j]) ans1++;
            }
            for (int w = 0; w < n; w++) {
              if ((w + 1) % 2 == 1 && mx[w][q] != l[j]) ans2++;
              if ((w + 1) % 2 == 0 && mx[w][q] != l[i]) ans2++;
            }
          }
          if (ans1 < ans2) {
            p[q] = 1;
            all += ans1;
          } else {
            p[q] = 2;
            all += ans2;
          }
        }
        if (all < top) {
          top = all;
          f1 = i;
          s1 = j;
          f2 = x;
          s2 = y;
          r.resize(m);
          r = p;
        }
      }
    }
  }
}
void left() {
  vector<vector<char>> _mx(m, vector<char>(n));
  for (int i = 0; i < n; i++) {
    string s = "";
    for (int j = 0; j < m; j++) s += mx[i][j];
    for (int j = m - 1, q = 0; j >= 0; j--, q++) _mx[j][i] = s[q];
  }
  swap(n, m);
  mx.assign(n, vector<char>(m));
  mx = _mx;
}
void right() {
  vector<vector<char>> _mx(m, vector<char>(n));
  for (int i = 0; i < m; i++) {
    string s = "";
    for (int j = n - 1; j >= 0; j--) s += mx[j][i];
    for (int j = 0; j < n; j++) _mx[i][j] = s[j];
  }
  swap(n, m);
  mx.assign(n, vector<char>(m));
  mx = _mx;
}
void ARRIAS() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cout << mx[i][j];
    cout << endl;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n >> m;
  mx.assign(n, vector<char>(m));
  r.resize(m);
  p.resize(m);
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < m; j++) mx[i][j] = s[j];
  }
  ARTHAS();
  int OLD = top;
  vector<int> past(m);
  past = r;
  right();
  ARTHAS();
  bool flag = 0;
  if (top == OLD && past == r) {
    left();
    flag = 1;
  }
  for (int i = 0; i < m; i++) {
    int turn = r[i];
    if ((i + 1) % 2 == 1) {
      for (int j = 0; j < n; j++) {
        if (turn == 1)
          mx[j][i] = l[f2];
        else
          mx[j][i] = l[s2];
        if (turn == 1)
          turn = 2;
        else
          turn = 1;
      }
    } else {
      for (int j = 0; j < n; j++) {
        if (turn == 1)
          mx[j][i] = l[f1];
        else
          mx[j][i] = l[s1];
        if (turn == 1)
          turn = 2;
        else
          turn = 1;
      }
    }
  }
  if (flag == 0) left();
  ARRIAS();
  return 0;
}
