#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
ostream& operator<<(ostream& out, const pair<A, B>& a) {
  return out << "(" << a.first << ", " << a.second << ")";
}
template <int>
ostream& operator<<(ostream& os, const vector<int>& v) {
  os << "[";
  for (int i = 0; i < v.size(); ++i) {
    if (v[i] != 1000000001)
      os << v[i];
    else
      os << "INF";
    if (i != v.size() - 1) os << ", ";
  }
  os << "]\n";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "[";
  for (int i = 0; i < v.size(); ++i) {
    os << v[i];
    ;
    if (i != v.size() - 1) os << ", ";
  }
  os << "]\n";
  return os;
}
int getCount(vector<string>& v, string& s, vector<string>& w) {
  int n = v.size(), m = v[0].size();
  int cnt = 0;
  for (int j = 0; j < m; j++) {
    int cnt1 = 0, cnt2 = 0;
    string s1, s2;
    int offset = (j & 1) * 2;
    for (int i = 0; i < n; i++) {
      if (s[(i % 2 == 1) + offset] == v[i][j]) cnt1++;
      s1 += s[(i % 2 == 1) + offset];
    }
    for (int i = 0; i < n; i++) {
      if (s[(i % 2 != 1) + offset] == v[i][j]) cnt2++;
      s2 += s[(i % 2 != 1) + offset];
    }
    if (cnt1 > cnt2)
      for (int i = 0; i < n; i++) w[i] += s1[i];
    else
      for (int i = 0; i < n; i++) w[i] += s2[i];
    cnt += max(cnt1, cnt2);
  }
  return cnt;
}
int main() {
  {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
  };
  int n, m;
  cin >> n >> m;
  vector<string> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  vector<string> trial = {"AGTC", "ACTG", "ATGC", "CGAT", "CTAG", "GTAC"};
  vector<string> ans, w(n);
  int max1 = -1;
  for (auto s : trial) {
    vector<string> w(n);
    int tempAns = getCount(v, s, w);
    if (tempAns > max1) {
      max1 = tempAns;
      ans = w;
    }
  }
  int max2 = -1;
  vector<string> vt(m);
  for (int j = 0; j < m; j++) {
    for (int i = 0; i < n; i++) vt[j] += v[i][j];
  }
  vector<string> anst;
  for (auto s : trial) {
    vector<string> w(m);
    int tempAns = getCount(vt, s, w);
    if (tempAns > max2) {
      max2 = tempAns;
      anst = w;
    }
  }
  if (max1 > max2) {
    for (auto it : ans) {
      for (auto it2 : it) cout << it2;
      cout << endl;
    }
  } else {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) cout << anst[j][i];
      cout << endl;
    }
  }
  return 0;
}
