#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void amin(T &x, const T &y) {
  if (y < x) x = y;
}
template <class T>
inline void amax(T &x, const T &y) {
  if (x < y) x = y;
}
template <class Iter>
void rprintf(const char *fmt, Iter begin, Iter end) {
  for (bool sp = 0; begin != end; ++begin) {
    if (sp)
      putchar(' ');
    else
      sp = true;
    printf(fmt, *begin);
  }
  putchar('\n');
}
const string P[6][2] = {
    {"AG", "CT"}, {"AC", "GT"}, {"AT", "GC"},
    {"GC", "AT"}, {"GT", "AC"}, {"CT", "AG"},
};
int ord(char c) {
  if (c == 'A') return 0;
  if (c == 'G') return 1;
  if (c == 'C') return 2;
  if (c == 'T') return 3;
  return 4;
}
void solve(vector<string> &F, int &ans) {
  int N = F.size();
  int M = F[0].size();
  int best_t = -1;
  ans = 1 << 29;
  for (int t = 0, t_len = (6); t < t_len; ++t) {
    int cost = 0;
    for (int i = 0, i_len = (N); i < i_len; ++i) {
      const string &pat = P[t][i & 1];
      int line_cost = 1 << 29;
      for (int a = 0, a_len = (2); a < a_len; ++a) {
        int tmp = 0;
        for (int j = 0, j_len = (M); j < j_len; ++j) {
          tmp += (int)(F[i][j] != pat[(j + a) & 1]);
        }
        amin(line_cost, tmp);
      }
      cost += line_cost;
    }
    if (ans > cost) {
      ans = cost;
      best_t = t;
    }
  }
  {
    for (int i = 0, i_len = (N); i < i_len; ++i) {
      const string &pat = P[best_t][i & 1];
      int tmp[2] = {};
      for (int a = 0, a_len = (2); a < a_len; ++a) {
        for (int j = 0, j_len = (M); j < j_len; ++j) {
          tmp[a] += (int)(F[i][j] != pat[(j + a) & 1]);
        }
      }
      int a = (tmp[0] > tmp[1] ? 1 : 0);
      for (int j = 0, j_len = (M); j < j_len; ++j) F[i][j] = pat[(j + a) & 1];
    }
  }
}
int N, M;
vector<string> F, G;
char buf[300111];
void MAIN() {
  scanf("%d%d", &N, &M);
  F.resize(N);
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    scanf("%s", buf);
    F[i] = buf;
  }
  G.assign(M, string(N, '.'));
  for (int i = 0, i_len = (N); i < i_len; ++i)
    for (int j = 0, j_len = (M); j < j_len; ++j) G[j][i] = F[i][j];
  int f_cost, g_cost;
  solve(F, f_cost);
  solve(G, g_cost);
  if (g_cost < f_cost) {
    for (int i = 0, i_len = (N); i < i_len; ++i)
      for (int j = 0, j_len = (M); j < j_len; ++j) F[i][j] = G[j][i];
  }
  for (int i = 0, i_len = (N); i < i_len; ++i) puts(F[i].c_str());
}
int main() {
  int TC = 1;
  for (int tc = 0, tc_len = (TC); tc < tc_len; ++tc) MAIN();
  return 0;
}
