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;
long long i, j, k, l, n, m, timer, res;
vector<vector<long long> > a, na;
long long nums[300009][5][2];
vector<pair<long long, long long> > c, ress;
vector<string> mres, nres;
string s;
long long count(long long num1, long long num2, long long num3,
                long long num4) {
  long long curr = nums[1][num1][0] + nums[1][num2][1];
  c[1] = {num2, num1};
  for (i = 2; i <= n; i++) {
    if (i % 2 == 0) {
      if (nums[i][num3][0] + nums[i][num4][1] >
          nums[i][num3][1] + nums[i][num4][0])
        c[i] = {num4, num3};
      else
        c[i] = {num3, num4};
      curr += max(nums[i][num3][0] + nums[i][num4][1],
                  nums[i][num3][1] + nums[i][num4][0]);
    }
    if (i % 2 == 1) {
      if (nums[i][num1][0] + nums[i][num2][1] >
          nums[i][num1][1] + nums[i][num2][0])
        c[i] = {num2, num1};
      else
        c[i] = {num1, num2};
      curr += max(nums[i][num1][0] + nums[i][num2][1],
                  nums[i][num1][1] + nums[i][num2][0]);
    }
  }
  return curr;
}
char get(long long num) {
  if (num == 1) return 'A';
  if (num == 2) return 'G';
  if (num == 3) return 'C';
  if (num == 4) return 'T';
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  long long nn = n, mm = m;
  a.resize(n + 1);
  c.resize(max(m, n) + 1);
  ress.resize(max(n, m) + 1);
  for (i = 1; i <= n; i++) {
    cin >> s;
    a[i].resize(m + 1);
    for (j = 1; j <= m; j++) {
      if (s[j - 1] == 'A') a[i][j] = 1;
      if (s[j - 1] == 'G') a[i][j] = 2;
      if (s[j - 1] == 'C') a[i][j] = 3;
      if (s[j - 1] == 'T') a[i][j] = 4;
      nums[i][a[i][j]][j % 2]++;
    }
  }
  vector<long long> aa = {1, 2, 3, 4};
  res = ((long long)1e18 + 9ll);
  do {
    long long num = count(aa[0], aa[1], aa[2], aa[3]);
    if (n * m - num < res) {
      res = n * m - num;
      ress = c;
    }
  } while (next_permutation(aa.begin(), aa.end()));
  long long flag = 0;
  mres.resize(n + 1);
  for (i = 1; i <= n; i++) {
    mres[i] += '0';
    for (j = 1; j <= m; j++) {
      if (j % 2 == 1)
        mres[i] += get(ress[i].first);
      else
        mres[i] += get(ress[i].second);
    }
  }
  na = a;
  a.resize(m + 1);
  for (i = 1; i <= m; i++) a[i].resize(n + 1);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      a[j][i] = na[i][j];
    }
  }
  memset(nums, 0, sizeof(nums));
  swap(n, m);
  for (i = 1; i <= n; i++) {
    a[i].resize(m + 1);
    for (j = 1; j <= m; j++) {
      nums[i][a[i][j]][j % 2]++;
    }
  }
  aa = {1, 2, 3, 4};
  do {
    long long num = count(aa[0], aa[1], aa[2], aa[3]);
    if (n * m - num < res) {
      res = n * m - num;
      ress = c;
      flag = 1;
    }
  } while (next_permutation(aa.begin(), aa.end()));
  nres.resize(n + 1);
  for (i = 1; i <= n; i++) {
    nres[i] += '0';
    for (j = 1; j <= m; j++) {
      if (j % 2 == 1)
        nres[i] += get(ress[i].first);
      else
        nres[i] += get(ress[i].second);
    }
  }
  if (flag) {
    for (i = 1; i <= m; i++) {
      mres[i] = "";
      for (j = 0; j <= n; j++) mres[i] += '0';
    }
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= m; j++) {
        mres[j][i] = nres[i][j];
      }
    }
  }
  swap(n, m);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) cout << mres[i][j];
    cout << '\n';
  }
  exit(0);
}
