#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
vector<vector<int> > a, b, best;
int res = -1;
int main() {
  ios::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  a.resize(n);
  for (int i = 0; i < (int)(n); ++i) {
    string s;
    cin >> s;
    a[i].resize(m);
    for (int j = 0; j < (int)(m); ++j) {
      if (s[j] == 'A') {
        a[i][j] = 0;
      } else if (s[j] == 'G') {
        a[i][j] = 1;
      } else if (s[j] == 'C') {
        a[i][j] = 2;
      } else if (s[j] == 'T') {
        a[i][j] = 3;
      }
    }
  }
  b = a;
  for (int x = 0; x < (int)(4); ++x) {
    for (int y = 0; y < (int)(x); ++y) {
      for (int z = 0; z < (int)(4); ++z) {
        for (int t = 0; t < (int)(z); ++t) {
          if (x == z || x == t || y == z || y == t) {
            continue;
          }
          int sum = 0;
          for (int i = 0; i < (int)(n); ++i) {
            int cur1 = 0, cur2 = 0;
            vector<int> bb1(m), bb2(m);
            if (i % 2) {
              for (int j = 0; j < (int)(m); ++j) {
                bb1[j] = j % 2 ? x : y;
                bb2[j] = j % 2 ? y : x;
              }
            } else {
              for (int j = 0; j < (int)(m); ++j) {
                bb1[j] = j % 2 ? z : t;
                bb2[j] = j % 2 ? t : z;
              }
            }
            for (int j = 0; j < (int)(m); ++j) {
              if (a[i][j] == bb1[j]) {
                ++cur1;
              }
              if (a[i][j] == bb2[j]) {
                ++cur2;
              }
            }
            if (cur1 > cur2) {
              sum += cur1;
              b[i] = bb1;
            } else {
              sum += cur2;
              b[i] = bb2;
            }
          }
          if (sum > res) {
            res = sum;
            best = b;
          }
          sum = 0;
          for (int j = 0; j < (int)(m); ++j) {
            int cur1 = 0, cur2 = 0;
            vector<int> bb1(n), bb2(n);
            if (j % 2) {
              for (int i = 0; i < (int)(n); ++i) {
                bb1[i] = i % 2 ? x : y;
                bb2[i] = i % 2 ? y : x;
              }
            } else {
              for (int i = 0; i < (int)(n); ++i) {
                bb1[i] = i % 2 ? z : t;
                bb2[i] = i % 2 ? t : z;
              }
            }
            for (int i = 0; i < (int)(n); ++i) {
              if (a[i][j] == bb1[i]) {
                ++cur1;
              }
              if (a[i][j] == bb2[i]) {
                ++cur2;
              }
            }
            if (cur1 > cur2) {
              sum += cur1;
              for (int i = 0; i < (int)(n); ++i) {
                b[i][j] = bb1[i];
              }
            } else {
              sum += cur2;
              for (int i = 0; i < (int)(n); ++i) {
                b[i][j] = bb2[i];
              }
            }
          }
          if (sum > res) {
            res = sum;
            best = b;
          }
        }
      }
    }
  }
  for (int i = 0; i < (int)(n); ++i) {
    for (int j = 0; j < (int)(m); ++j) {
      if (best[i][j] == 0) {
        cout << 'A';
      } else if (best[i][j] == 1) {
        cout << 'G';
      } else if (best[i][j] == 2) {
        cout << 'C';
      } else if (best[i][j] == 3) {
        cout << 'T';
      }
    }
    cout << endl;
  }
  return 0;
}
