#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const string str = "ATGC";
vector<string> s;
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    string st;
    cin >> st;
    s.push_back(st);
  }
  int ansmin = INF;
  vector<string> ans;
  for (int c1 = 0; c1 < 4; c1++)
    for (int c2 = c1 + 1; c2 < 4; c2++) {
      string t;
      set<int> st;
      for (int i = 0; i < 4; i++) st.insert(i);
      st.erase(c1);
      st.erase(c2);
      auto it = st.begin();
      t.push_back(str[c1]);
      t.push_back(str[c2]);
      t.push_back(str[*(it++)]);
      t.push_back(str[*it]);
      int diff = 0;
      vector<string> tmp(n);
      for (int i = 0; i < n; i++) {
        int b = (i % 2) * 2;
        int d1 = 0, d2 = 0;
        for (int j = 0; j < m; j++) {
          if (s[i][j] != t[b + (j % 2)]) d1++;
          if (s[i][j] != t[b + (j + 1) % 2]) d2++;
        }
        if (d1 < d2) {
          for (int j = 0; j < m; j++) tmp[i].push_back(t[b + (j % 2)]);
        } else {
          for (int j = 0; j < m; j++) tmp[i].push_back(t[b + (j + 1) % 2]);
        }
        diff += min(d1, d2);
      }
      if (diff < ansmin) {
        ans = tmp;
        ansmin = diff;
      }
      diff = 0;
      tmp.clear();
      tmp.resize(n);
      for (int j = 0; j < m; j++) {
        int b = (j % 2) * 2;
        int d1 = 0, d2 = 0;
        for (int i = 0; i < n; i++) {
          if (s[i][j] != t[b + (i % 2)]) d1++;
          if (s[i][j] != t[b + (i + 1) % 2]) d2++;
        }
        if (d1 < d2) {
          for (int i = 0; i < n; i++) tmp[i].push_back(t[b + (i % 2)]);
        } else {
          for (int i = 0; i < n; i++) tmp[i].push_back(t[b + (i + 1) % 2]);
        }
        diff += min(d1, d2);
      }
      if (diff < ansmin) {
        ans = tmp;
        ansmin = diff;
      }
    }
  for (int i = 0; i < n; i++) cout << ans[i] << endl;
  return 0;
}
