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;
const int MAXN = 300010;
const int INF = 1000000000;
bool Check(string A, string B) {
  set<char> s;
  s.insert(A[0]);
  s.insert(A[1]);
  s.insert(B[0]);
  s.insert(B[1]);
  if (s.size() != 4) return false;
  s.clear();
  s.insert(A[1]);
  s.insert(A[2]);
  s.insert(B[1]);
  s.insert(B[2]);
  if (s.size() != 4) return false;
  s.clear();
  s.insert(A[2]);
  s.insert(A[3]);
  s.insert(B[2]);
  s.insert(B[3]);
  if (s.size() != 4) return false;
  return true;
}
const int C = 36;
vector<string> B;
vector<vector<int>> e;
pair<int, int> Solve(int n, int m, vector<vector<int>>& f,
                     vector<vector<int>>& fp, const vector<vector<char>>& x) {
  for (int i = 0; i < C; ++i) {
    f[0][i] = 0;
    for (int j = 0; j < m; ++j) {
      f[0][i] += x[0][j] != B[i][j % 4];
    }
  }
  for (int i = 0; i + 1 < n; ++i) {
    vector<int> cnt(C);
    for (int j = 0; j < C; ++j) {
      for (int k = 0; k < m; ++k) {
        cnt[j] += x[i + 1][k] != B[j][k % 4];
      }
    }
    for (int j = 0; j < C; ++j) {
      for (int k : e[j]) {
        if (f[i][k] < f[i + 1][j]) {
          f[i + 1][j] = f[i][k];
          fp[i + 1][j] = k;
        }
      }
      f[i + 1][j] += cnt[j];
    }
  }
  int ansc = INF, p = -1;
  for (int i = 0; i < C; ++i) {
    if (f[n - 1][i] < ansc) {
      ansc = f[n - 1][i];
      p = i;
    }
  }
  return {ansc, p};
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<string> x(n);
  for (int i = 0; i < n; ++i) cin >> x[i];
  B = {"AGAG", "AGCT", "AGTC", "GAGA", "GACT", "GATC", "ACAC", "ACTG", "ACGT",
       "CACA", "CATG", "CAGT", "ATAT", "ATCG", "ATGC", "TATA", "TACG", "TAGC",
       "CTCT", "CTAG", "CTGA", "TCTC", "TCAG", "TCGA", "CGCG", "CGAT", "CGTA",
       "GCGC", "GCTA", "GCAT", "TGTG", "TGAC", "TGCA", "GTGT", "GTAC", "GTCA"};
  e = vector<vector<int>>(C);
  for (int i = 0; i < C; ++i) {
    for (int j = 0; j < C; ++j) {
      if (Check(B[i], B[j])) e[i].push_back(j);
    }
  }
  vector<vector<int>> fr(n, vector<int>(C, INF));
  vector<vector<int>> frp(n, vector<int>(C, -1));
  vector<vector<char>> xr(n, vector<char>(m));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) xr[i][j] = x[i][j];
  }
  auto [ansr, pr] = Solve(n, m, fr, frp, xr);
  vector<vector<int>> fc(m, vector<int>(C, INF));
  vector<vector<int>> fcp(m, vector<int>(C, -1));
  vector<vector<char>> xc(m, vector<char>(n));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) xc[j][i] = x[i][j];
  }
  auto [ansc, pc] = Solve(m, n, fc, fcp, xc);
  if (ansr <= ansc) {
    vector<vector<char>> ans(n, vector<char>(m));
    int p = pr;
    for (int i = n - 1; i >= 0; --i) {
      for (int j = 0; j < m; ++j) ans[i][j] = B[p][j % 4];
      p = frp[i][p];
    }
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) cout << ans[i][j];
      cout << endl;
    }
  } else {
    vector<vector<char>> ans(m, vector<char>(n));
    int p = pc;
    for (int i = m - 1; i >= 0; --i) {
      for (int j = 0; j < n; ++j) ans[i][j] = B[p][j % 4];
      p = fcp[i][p];
    }
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) cout << ans[j][i];
      cout << endl;
    }
  }
  return 0;
}
