#include <bits/stdc++.h>
using namespace std;
int n, m, ma;
vector<string> en;
vector<string> res;
vector<string> can;
int che(int i, char c1, char c2) {
  int c = 0;
  int j;
  for (j = 0; j < m; j += 2)
    if (en[i][j] == c1) c++;
  for (j = 1; j < m; j += 2)
    if (en[i][j] == c2) c++;
  return c;
}
int che2(int j, char c1, char c2) {
  int c = 0;
  int i;
  for (i = 0; i < n; i += 2)
    if (en[i][j] == c1) c++;
  for (i = 1; i < n; i += 2)
    if (en[i][j] == c2) c++;
  return c;
}
void p1(int i, char c1, char c2) {
  int j;
  for (j = 0; j < m; j += 2) can[i][j] = c1;
  for (j = 1; j < m; j += 2) can[i][j] = c2;
}
void p2(int j, char c1, char c2) {
  int i;
  for (i = 0; i < n; i += 2) can[i][j] = c1;
  for (i = 1; i < n; i += 2) can[i][j] = c2;
}
void fu(char c1, char c2, char c3, char c4) {
  int i, mc = 0, ca1, ca2;
  for (i = 0; i < n; i += 2) {
    ca1 = che(i, c1, c2);
    ca2 = che(i, c2, c1);
    if (ca1 > ca2) {
      mc += ca1;
      p1(i, c1, c2);
    } else {
      mc += ca2;
      p1(i, c2, c1);
    }
  }
  for (i = 1; i < n; i += 2) {
    ca1 = che(i, c3, c4);
    ca2 = che(i, c4, c3);
    if (ca1 > ca2) {
      mc += ca1;
      p1(i, c3, c4);
    } else {
      mc += ca2;
      p1(i, c4, c3);
    }
  }
  if (mc > ma) {
    ma = mc;
    res = can;
  }
  mc = 0;
  for (i = 0; i < m; i += 2) {
    ca1 = che2(i, c1, c2);
    ca2 = che2(i, c2, c1);
    if (ca1 > ca2) {
      mc += ca1;
      p2(i, c1, c2);
    } else {
      mc += ca2;
      p2(i, c2, c1);
    }
  }
  for (i = 1; i < m; i += 2) {
    ca1 = che2(i, c3, c4);
    ca2 = che2(i, c4, c3);
    if (ca1 > ca2) {
      mc += ca1;
      p2(i, c3, c4);
    } else {
      mc += ca2;
      p2(i, c4, c3);
    }
  }
  if (mc > ma) {
    ma = mc;
    res = can;
  }
}
int main() {
  cin >> n >> m;
  en.resize(n);
  can.resize(n);
  int i, ma = 0;
  for (i = 0; i < n; i++) {
    cin >> en[i];
    can[i] = en[i];
  }
  fu('G', 'C', 'T', 'A');
  fu('G', 'T', 'C', 'A');
  fu('G', 'A', 'T', 'C');
  fu('A', 'C', 'G', 'T');
  fu('T', 'C', 'G', 'A');
  fu('T', 'A', 'G', 'C');
  for (i = 0; i < n; i++) {
    cout << res[i] << endl;
  }
  return 0;
}
