#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const long long inf = numeric_limits<long long>::max() / 2;
const long double eps = 1e-9;
const long double pi = acosl(-1);
template <typename T>
inline bool mineq(T& a, T b) {
  return (a > b) ? (a = b, 1) : 0;
}
template <typename T>
inline bool maxeq(T& a, T b) {
  return (a < b) ? (a = b, 1) : 0;
}
inline void solve(), read();
const string file = "";
signed main() {
  if (file != "") {
    freopen((file + ".in").c_str(), "r", stdin);
    freopen((file + ".out").c_str(), "w", stdout);
  }
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  read();
  solve();
  return 0;
}
long long n, m;
vector<vector<long long>> a;
vector<vector<long long>> b;
string agtc = "AGTC";
long long tonum(char c) { return agtc.find(c); }
char tochar(long long i) { return agtc[i]; }
long long check_string(vector<long long>& a, vector<long long>& b) {
  long long ans = 0;
  for (long long i = 0; i < (long long)((a).size()); i++) {
    ans += a[i] != b[i];
  }
  return ans;
}
vector<long long> choose(long long m, long long i, long long i0, long long i1) {
  vector<long long> c(m);
  vector<long long> d(m);
  for (long long j = 0; j < m; j += 2) {
    c[j] = i0;
    d[j] = i1;
  }
  for (long long j = 1; j < m; j += 2) {
    c[j] = i1;
    d[j] = i0;
  }
  long long c1 = check_string(a[i], c);
  long long c2 = check_string(a[i], d);
  if (c1 <= c2) {
    return c;
  } else {
    return d;
  }
}
void gen(vector<long long>& ind, long long n, long long m) {
  b.assign(n, vector<long long>(m, 0));
  for (long long i = 0; i < n; i += 2) {
    b[i] = choose(m, i, ind[0], ind[1]);
  }
  for (long long i = 1; i < n; i += 2) {
    b[i] = choose(m, i, ind[2], ind[3]);
  }
}
long long check(long long n) {
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    ans += check_string(a[i], b[i]);
  }
  return ans;
}
pair<long long, vector<vector<long long>>> gen_table(long long n, long long m) {
  b.assign(n, vector<long long>(m, 0));
  vector<long long> ind(4);
  iota((ind).begin(), (ind).end(), 0);
  long long ans = inf;
  vector<long long> best;
  do {
    gen(ind, n, m);
    if (mineq(ans, check(n))) {
      best = ind;
    }
  } while (next_permutation((ind).begin(), (ind).end()));
  gen(best, n, m);
  return {check(n), b};
}
inline void solve() {
  auto g1 = gen_table(n, m);
  vector<vector<long long>> c(m, vector<long long>(n, 0));
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      c[j][i] = a[i][j];
    }
  }
  a = c;
  auto g2 = gen_table(m, n);
  vector<vector<long long>> ans;
  if (g1.first <= g2.first) {
    ans = g1.second;
  } else {
    vector<vector<long long>> d(n, vector<long long>(m, 0));
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < m; j++) {
        d[i][j] = g2.second[j][i];
      }
    }
    ans = d;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cout << tochar(ans[i][j]);
    }
    cout << "\n";
  }
}
inline void read() {
  cin >> n >> m;
  a.resize(n, vector<long long>(m, 0));
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      char c;
      cin >> c;
      a[i][j] = tonum(c);
    }
  }
}
