#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<string> s;
pair<char, char> a[6] = {{'A', 'T'}, {'A', 'G'}, {'A', 'C'},
                         {'G', 'C'}, {'T', 'C'}, {'G', 'T'}};
vector<int> now1, now2;
vector<vector<char>> ans;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    char temp[200100];
    scanf("%s", temp);
    string tt(temp);
    s.push_back(tt);
  }
  ans.resize(n + 1);
  for (auto &e : ans) e.resize(m + 1);
  int res = -1;
  for (int i = 0; i < 6; i++) {
    now1.clear();
    pair<char, char> p = a[i];
    pair<char, char> q = a[(i + 3) % 6];
    int nowres = 0;
    for (int j = 0; j < n; j++) {
      if (j & 1) {
        int t1 = 0;
        int t2 = 0;
        for (int k = 0; k < m; k++) {
          if (k & 1) {
            if (s[j][k] == p.first) t1++;
            if (s[j][k] == p.second) t2++;
          } else {
            if (s[j][k] == p.second) t1++;
            if (s[j][k] == p.first) t2++;
          }
        }
        if (t1 > t2)
          now1.push_back(0);
        else
          now1.push_back(1);
        nowres += max(t1, t2);
      } else {
        int t1 = 0;
        int t2 = 0;
        for (int k = 0; k < m; k++) {
          if (k & 1) {
            if (s[j][k] == q.first) t1++;
            if (s[j][k] == q.second) t2++;
          } else {
            if (s[j][k] == q.second) t1++;
            if (s[j][k] == q.first) t2++;
          }
        }
        if (t1 > t2)
          now1.push_back(0);
        else
          now1.push_back(1);
        nowres += max(t1, t2);
      }
    }
    if (res < nowres) {
      res = nowres;
      for (int j = 0; j < n; j++) {
        if (j & 1)
          for (int k = 0; k < m; k++) {
            if ((k + now1[j]) & 1)
              ans[j][k] = p.first;
            else
              ans[j][k] = p.second;
          }
        else
          for (int k = 0; k < m; k++) {
            if ((k + now1[j]) & 1)
              ans[j][k] = q.first;
            else
              ans[j][k] = q.second;
          }
      }
    }
  }
  for (int i = 0; i < 6; i++) {
    now2.clear();
    pair<char, char> p = a[i];
    pair<char, char> q = a[(i + 3) % 6];
    int nowres = 0;
    for (int j = 0; j < m; j++) {
      if (j & 1) {
        int t1 = 0;
        int t2 = 0;
        for (int k = 0; k < n; k++) {
          if (k & 1) {
            if (s[k][j] == p.first) t1++;
            if (s[k][j] == p.second) t2++;
          } else {
            if (s[k][j] == p.second) t1++;
            if (s[k][j] == p.first) t2++;
          }
        }
        if (t1 > t2)
          now2.push_back(0);
        else
          now2.push_back(1);
        nowres += max(t1, t2);
      } else {
        int t1 = 0;
        int t2 = 0;
        for (int k = 0; k < n; k++) {
          if (k & 1) {
            if (s[k][j] == q.first) t1++;
            if (s[k][j] == q.second) t2++;
          } else {
            if (s[k][j] == q.second) t1++;
            if (s[k][j] == q.first) t2++;
          }
        }
        if (t1 > t2)
          now2.push_back(0);
        else
          now2.push_back(1);
        nowres += max(t1, t2);
      }
    }
    if (res < nowres) {
      res = nowres;
      for (int k = 0; k < m; k++) {
        if (k & 1)
          for (int j = 0; j < n; j++) {
            if ((j + now2[k]) & 1)
              ans[j][k] = p.first;
            else
              ans[j][k] = p.second;
          }
        else
          for (int j = 0; j < n; j++) {
            if ((j + now2[k]) & 1)
              ans[j][k] = q.first;
            else
              ans[j][k] = q.second;
          }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) printf("%c", ans[i][j]);
    printf("\n");
  }
  return 0;
}
