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;
const int inf = 0x3f3f3f3f, mod = 1000000007;
const double pi = 3.1415926535897932, eps = 1e-6;
void chmax(int &x, int y) {
  if (x < y) x = y;
}
void chmin(int &x, int y) {
  if (x > y) x = y;
}
int n, m, ansc;
string s[300005], t[300005], ans[300005], pat[300005];
char mpc[5] = "ACGT";
bool flg;
void deal(bool mode) {
  int tmp = 0;
  for (int(i) = (1); (i) <= (n); (i)++) pat[i] = "";
  for (int(i) = (1); (i) <= (n); (i)++) pat[i].resize(m + 1);
  for (int(a) = (0); (a) <= (3); (a)++)
    for (int(b) = (a + 1); (b) <= (3); (b)++) {
      tmp = 0;
      int c = 0, d = 0;
      while (c == a || c == b) c++;
      while (d == a || d == b || d == c) d++;
      for (int(i) = (1); (i) <= (n); (i)++) {
        int num1 = 0, num2 = 0;
        if (i & 1) {
          for (int(j) = (1); (j) <= (m); (j)++) {
            if (j & 1)
              num1 += (s[i][j] == mpc[a]);
            else
              num1 += (s[i][j] == mpc[b]);
          }
          for (int(j) = (1); (j) <= (m); (j)++) {
            if (j & 1)
              num2 += (s[i][j] == mpc[b]);
            else
              num2 += (s[i][j] == mpc[a]);
          }
          if (num1 > num2)
            for (int(j) = (1); (j) <= (m); (j)++)
              pat[i][j] = (j & 1) ? mpc[a] : mpc[b];
          else
            for (int(j) = (1); (j) <= (m); (j)++)
              pat[i][j] = (j & 1) ? mpc[b] : mpc[a];
          tmp += max(num1, num2);
        } else {
          for (int(j) = (1); (j) <= (m); (j)++) {
            if (j & 1)
              num1 += (s[i][j] == mpc[c]);
            else
              num1 += (s[i][j] == mpc[d]);
          }
          for (int(j) = (1); (j) <= (m); (j)++) {
            if (j & 1)
              num2 += (s[i][j] == mpc[d]);
            else
              num2 += (s[i][j] == mpc[c]);
          }
          if (num1 > num2)
            for (int(j) = (1); (j) <= (m); (j)++)
              pat[i][j] = (j & 1) ? mpc[c] : mpc[d];
          else
            for (int(j) = (1); (j) <= (m); (j)++)
              pat[i][j] = (j & 1) ? mpc[d] : mpc[c];
          tmp += max(num1, num2);
        }
      }
      if (tmp > ansc) {
        for (int(i) = (1); (i) <= (n); (i)++) ans[i] = pat[i];
        if (mode) flg = 1;
        ansc = tmp;
      }
    }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int(i) = (1); (i) <= (n); (i)++) {
    cin >> s[i];
    s[i] = ' ' + s[i];
  }
  deal(0);
  for (int(i) = (1); (i) <= (m); (i)++) t[i].resize(n + 1);
  for (int(i) = (1); (i) <= (n); (i)++)
    for (int(j) = (1); (j) <= (m); (j)++) t[j][i] = s[i][j];
  swap(n, m);
  for (int(i) = (1); (i) <= (n); (i)++) s[i] = t[i];
  deal(1);
  if (!flg)
    for (int(i) = (1); (i) <= (m); (i)++) cout << ans[i].substr(1) << '\n';
  else {
    for (int(i) = (1); (i) <= (m); (i)++) t[i] = "";
    for (int(i) = (1); (i) <= (m); (i)++) t[i].resize(n + 1);
    for (int(i) = (1); (i) <= (n); (i)++)
      for (int(j) = (1); (j) <= (m); (j)++) t[j][i] = ans[i][j];
    for (int(i) = (1); (i) <= (m); (i)++) cout << t[i].substr(1) << '\n';
  }
  return 0;
}
