You are given an n × m table, consisting of characters «A», «G», «C», «T». Let's call a table nice, if every 2 × 2 square contains all four distinct characters. Your task is to find a nice table (also consisting of «A», «G», «C», «T»), that differs from the given table in the minimum number of characters.

Input

First line contains two positive integers n and m — number of rows and columns in the table you are given (2 ≤ n, m, n × m ≤ 300 000). Then, n lines describing the table follow. Each line contains exactly m characters «A», «G», «C», «T».

Output

Output n lines, m characters each. This table must be nice and differ from the input table in the minimum number of characters.

Examples

Input


2 2
AG
CT


Output


AG
CT


Input


3 5
AGCAG
AGCAG
AGCAG


Output


TGCAT
CATGC
TGCAT

Note

In the first sample, the table is already nice. In the second sample, you can change 9 elements to make the table nice.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pci = pair<char, int>;
using vi = vector<int>;
using vll = vector<ll>;
using vpii = vector<pii>;
const ll infll = 1e18 + 3;
const int maxn = 1e6 + 77;
const int nmax = 1e6 + 577;
const ll basell = 1e18 + 3;
const int mod = 1e9 + 7;
const ld eps = 1e-7;
const int inf = 1009000999;
const int nv = 100505;
const int baseint = 1000200013;
const ld PI = acos(-1.0);
inline bool EQ(ld a, ld b) { return fabs(a - b) < 1e-9; }
inline bool IF(int a, int b, int c) { return (a >= b && a <= c); }
inline bool IFS(int a, int b, int c) { return (a > b && a < c); }
template <typename T>
inline istream &operator>>(istream &_in, vector<T> &_v) {
  for (auto &_i : _v) {
    _in >> _i;
  }
  return _in;
}
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
string str[3 * nv];
map<pair<char, char>, int> ssd;
int inline solve() {
  ios::sync_with_stdio(NULL), cin.tie(NULL), cout.tie(NULL);
  ;
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> str[i];
  }
  string h = "AGCT";
  int ans = 0, v = 0;
  string anss;
  for (int g = 0; g < 32; ++g) {
    next_permutation(begin(h), end(h));
    char a, b, c, d;
    a = h[0];
    b = h[1];
    c = h[2];
    d = h[3];
    if (ssd[{h[1], h[0]}] == 1) continue;
    ssd[{h[0], h[1]}] = 1;
    int res = 0;
    for (int i = 0; i < n; ++i) {
      int u1 = 0, u2 = 0;
      for (int j = 0; j < m; ++j) {
        if (i % 2 == 0) {
          if (j % 2 == 0 && a == str[i][j]) {
            u1++;
          }
          if (j % 2 == 1 && b == str[i][j]) {
            u1++;
          }
        } else {
          if (j % 2 == 0 && c == str[i][j]) {
            u1++;
          }
          if (j % 2 == 1 && d == str[i][j]) {
            u1++;
          }
        }
        if (i % 2 == 0) {
          if (j % 2 == 0 && b == str[i][j]) {
            u2++;
          }
          if (j % 2 == 1 && a == str[i][j]) {
            u2++;
          }
        } else {
          if (j % 2 == 0 && d == str[i][j]) {
            u2++;
          }
          if (j % 2 == 1 && c == str[i][j]) {
            u2++;
          }
        }
      }
      res += max(u1, u2);
    }
    if (res > ans) {
      ans = res;
      anss = h;
      v = 0;
    }
    res = 0;
    for (int j = 0; j < m; ++j) {
      int u1 = 0, u2 = 0;
      for (int i = 0; i < n; ++i) {
        if (j % 2 == 0) {
          if (i % 2 == 0 && a == str[i][j]) {
            u1++;
          }
          if (i % 2 == 1 && b == str[i][j]) {
            u1++;
          }
        } else {
          if (i % 2 == 0 && c == str[i][j]) {
            u1++;
          }
          if (i % 2 == 1 && d == str[i][j]) {
            u1++;
          }
        }
        if (j % 2 == 0) {
          if (i % 2 == 0 && b == str[i][j]) {
            u2++;
          }
          if (i % 2 == 1 && a == str[i][j]) {
            u2++;
          }
        } else {
          if (i % 2 == 0 && d == str[i][j]) {
            u2++;
          }
          if (i % 2 == 1 && c == str[i][j]) {
            u2++;
          }
        }
      }
      res += max(u1, u2);
    }
    if (res > ans) {
      ans = res;
      anss = h;
      v = 1;
    }
  }
  if (v == 0) {
    char a, b, c, d;
    a = anss[0];
    b = anss[1];
    c = anss[2];
    d = anss[3];
    for (int i = 0; i < n; ++i) {
      int u1 = 0, u2 = 0;
      for (int j = 0; j < m; ++j) {
        if (i % 2 == 0) {
          if (j % 2 == 0 && a == str[i][j]) {
            u1++;
          }
          if (j % 2 == 1 && b == str[i][j]) {
            u1++;
          }
        } else {
          if (j % 2 == 0 && c == str[i][j]) {
            u1++;
          }
          if (j % 2 == 1 && d == str[i][j]) {
            u1++;
          }
        }
        if (i % 2 == 0) {
          if (j % 2 == 0 && b == str[i][j]) {
            u2++;
          }
          if (j % 2 == 1 && a == str[i][j]) {
            u2++;
          }
        } else {
          if (j % 2 == 0 && d == str[i][j]) {
            u2++;
          }
          if (j % 2 == 1 && c == str[i][j]) {
            u2++;
          }
        }
      }
      if (u1 > u2) {
        for (int j = 0; j < m; ++j) {
          if (i % 2 == 0) {
            if (j % 2 == 0) {
              cout << a;
            }
            if (j % 2 == 1) {
              cout << b;
            }
          } else {
            if (j % 2 == 0) {
              cout << c;
            }
            if (j % 2 == 1) {
              cout << d;
            }
          }
        }
      } else {
        for (int j = 0; j < m; ++j) {
          if (i % 2 == 0) {
            if (j % 2 == 0) {
              cout << b;
            } else {
              cout << a;
            }
          } else {
            if (j % 2 == 0) {
              cout << d;
            } else {
              cout << c;
            }
          }
        }
      }
      cout << '\n';
    }
  } else {
    char a, b, c, d;
    a = anss[0];
    b = anss[1];
    c = anss[2];
    d = anss[3];
    vector<string> sd;
    sd.reserve(m);
    string ff;
    for (int j = 0; j < m; ++j) {
      int u1 = 0, u2 = 0;
      for (int i = 0; i < n; ++i) {
        if (j % 2 == 0) {
          if (i % 2 == 0 && a == str[i][j]) {
            u1++;
          }
          if (i % 2 == 1 && b == str[i][j]) {
            u1++;
          }
        } else {
          if (i % 2 == 0 && c == str[i][j]) {
            u1++;
          }
          if (i % 2 == 1 && d == str[i][j]) {
            u1++;
          }
        }
        if (j % 2 == 0) {
          if (i % 2 == 0 && b == str[i][j]) {
            u2++;
          }
          if (i % 2 == 1 && a == str[i][j]) {
            u2++;
          }
        } else {
          if (i % 2 == 0 && d == str[i][j]) {
            u2++;
          }
          if (i % 2 == 1 && c == str[i][j]) {
            u2++;
          }
        }
      }
      if (u1 > u2) {
        for (int i = 0; i < n; ++i) {
          if (j % 2 == 0) {
            if (i % 2 == 0) {
              ff += a;
            }
            if (i % 2 == 1) {
              ff += b;
            }
          } else {
            if (i % 2 == 0) {
              ff += c;
            }
            if (i % 2 == 1) {
              ff += d;
            }
          }
        }
      } else {
        for (int i = 0; i < n; ++i) {
          if (j % 2 == 0) {
            if (i % 2 == 0) {
              ff += b;
            }
            if (i % 2 == 1) {
              ff += a;
            }
          } else {
            if (i % 2 == 0) {
              ff += d;
            }
            if (i % 2 == 1) {
              ff += c;
            }
          }
        }
      }
      sd.push_back(ff);
      ff = "";
    }
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) {
        cout << sd[j][i];
      }
      cout << '\n';
    }
  }
  return 0;
}
int32_t main() {
  solve();
  return 0;
}
