#include <bits/stdc++.h>
using namespace std;
long long add(long long a, long long b) {
  a += b;
  if (a >= 1000000007) return a - 1000000007;
  return a;
}
long long mul(long long a, long long b) {
  a *= b;
  if (a >= 1000000007) return a % 1000000007;
  return a;
}
long long power(long long a, long long b) {
  long long p = 1;
  while (b) {
    if (b & 1) p = mul(p, a);
    a = mul(a, a);
    b /= 2;
  }
  return p;
}
int n, m;
vector<vector<char> > a;
char c[4] = {'G', 'C', 'T', 'A'};
long long go1(int idx, char x, char y) {
  long long res = 0;
  for (int i = 0; i < m; i++) {
    if (i & 1)
      res += (a[idx][i] != y);
    else
      res += (a[idx][i] != x);
  }
  return res;
}
long long get1(char w, char x, char y, char z) {
  long long res = 0;
  for (int i = 0; i < n; i++) {
    if (i & 1)
      res += min(go1(i, y, z), go1(i, z, y));
    else
      res += min(go1(i, w, x), go1(i, x, w));
  }
  return res;
}
long long go2(int idx, char x, char y) {
  long long res = 0;
  for (int i = 0; i < n; i++) {
    if (i & 1)
      res += (a[i][idx] != y);
    else
      res += (a[i][idx] != x);
  }
  return res;
}
long long get2(char w, char x, char y, char z) {
  long long res = 0;
  for (int i = 0; i < m; i++) {
    if (i & 1)
      res += min(go2(i, y, z), go2(i, z, y));
    else
      res += min(go2(i, w, x), go2(i, x, w));
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  vector<char> t(m);
  a.assign(n, t);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> a[i][j];
  int tp;
  long long mn = 1e18;
  vector<char> cc(4);
  for (int i = 0; i < 4; i++) {
    for (int j = i + 1; j < 4; j++) {
      for (int ii = 0; ii < 4; ii++) {
        if (ii == i || ii == j) continue;
        for (int jj = ii + 1; jj < 4; jj++) {
          if (jj == i || jj == j) continue;
          long long val = get1(c[i], c[j], c[ii], c[jj]);
          if (val < mn) {
            mn = val;
            tp = 1;
            cc = {c[i], c[j], c[ii], c[jj]};
          }
        }
      }
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = i + 1; j < 4; j++) {
      for (int ii = 0; ii < 4; ii++) {
        if (ii == i || ii == j) continue;
        for (int jj = ii + 1; jj < 4; jj++) {
          if (jj == i || jj == j) continue;
          long long val = get2(c[i], c[j], c[ii], c[jj]);
          if (val < mn) {
            mn = val;
            tp = 2;
            cc = {c[i], c[j], c[ii], c[jj]};
          }
        }
      }
    }
  }
  vector<vector<char> > vv = a;
  if (tp == 1) {
    char w = cc[0], x = cc[1], y = cc[2], z = cc[3];
    for (int i = 0; i < n; i++) {
      if (i & 1) {
        if (go1(i, y, z) < go1(i, z, y)) {
          for (int j = 0; j < m; j++) {
            if (j & 1)
              vv[i][j] = z;
            else
              vv[i][j] = y;
          }
        } else {
          for (int j = 0; j < m; j++) {
            if (j & 1)
              vv[i][j] = y;
            else
              vv[i][j] = z;
          }
        }
      } else {
        if (go1(i, x, w) < go1(i, w, x)) {
          for (int j = 0; j < m; j++) {
            if (j & 1)
              vv[i][j] = w;
            else
              vv[i][j] = x;
          }
        } else {
          for (int j = 0; j < m; j++) {
            if (j & 1)
              vv[i][j] = x;
            else
              vv[i][j] = w;
          }
        }
      }
    }
  } else {
    char w = cc[0], x = cc[1], y = cc[2], z = cc[3];
    for (int i = 0; i < m; i++) {
      if (i & 1) {
        if (go2(i, y, z) < go2(i, z, y)) {
          for (int j = 0; j < n; j++) {
            if (j & 1)
              vv[j][i] = z;
            else
              vv[j][i] = y;
          }
        } else {
          for (int j = 0; j < n; j++) {
            if (j & 1)
              vv[j][i] = y;
            else
              vv[j][i] = z;
          }
        }
      } else {
        if (go2(i, w, x) < go2(i, x, w)) {
          for (int j = 0; j < n; j++) {
            if (j & 1)
              vv[j][i] = x;
            else
              vv[j][i] = w;
          }
        } else {
          for (int j = 0; j < n; j++) {
            if (j & 1)
              vv[j][i] = w;
            else
              vv[j][i] = x;
          }
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cout << vv[i][j];
    cout << '\n';
  }
  return 0;
}
