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;
int n, m;
char x[300005];
int ca[300005][2][4];
int cb[300005][2][4];
int aa[256];
char bbb[4];
int y[4], z[4], best = -1, bb, cur;
bool u[4];
vector<vector<char>> ans;
int ta, tb;
void go(int a) {
  if (a == 4) {
    cur = 0;
    for (int i = 0; i < n; i++) {
      ta = ca[i][0][y[0 + ((i & 1) << 1)]] + ca[i][1][y[1 + ((i & 1) << 1)]];
      tb = ca[i][0][y[1 + ((i & 1) << 1)]] + ca[i][1][y[0 + ((i & 1) << 1)]];
      cur += max(ta, tb);
    }
    if (cur > best) {
      best = cur;
      bb = 0;
      memcpy(z, y, sizeof(y[0]) * 4);
    }
    cur = 0;
    for (int i = 0; i < m; i++) {
      ta = cb[i][0][y[0 + ((i & 1) << 0)]] + cb[i][1][y[2 + ((i & 1) << 0)]];
      tb = cb[i][0][y[2 + ((i & 1) << 0)]] + cb[i][1][y[0 + ((i & 1) << 0)]];
      cur += max(ta, tb);
    }
    if (cur > best) {
      best = cur;
      bb = 1;
      memcpy(z, y, sizeof(y[0]) * 4);
    }
  } else
    for (int i = 0; i < 4; i++)
      if (!u[i]) {
        u[i] = 1;
        y[a] = i;
        go(a + 1);
        u[i] = 0;
      }
}
int main() {
  aa[bbb[0] = 'A'] = 0;
  aa[bbb[1] = 'G'] = 1;
  aa[bbb[2] = 'C'] = 2;
  aa[bbb[3] = 'T'] = 3;
  scanf("%d%d", &n, &m);
  ans = vector<vector<char>>(n, vector<char>(m));
  for (int i = 0; i < n; i++) {
    scanf("%s", x);
    for (int j = 0; j < m; j++) {
      x[j] = aa[x[j]];
      ca[i][j & 1][x[j]]++;
      cb[j][i & 1][x[j]]++;
    }
  }
  go(0);
  memcpy(y, z, sizeof(y[0]) * 4);
  if (bb == 0)
    for (int i = 0; i < n; i++) {
      ta = ca[i][0][y[0 + ((i & 1) << 1)]] + ca[i][1][y[1 + ((i & 1) << 1)]];
      tb = ca[i][0][y[1 + ((i & 1) << 1)]] + ca[i][1][y[0 + ((i & 1) << 1)]];
      if (ta > tb)
        for (int j = 0; j < m; j++)
          ans[i][j] = (j & 1) ? y[1 + ((i & 1) << 1)] : y[0 + ((i & 1) << 1)];
      else
        for (int j = 0; j < m; j++)
          ans[i][j] = (j & 1) ? y[0 + ((i & 1) << 1)] : y[1 + ((i & 1) << 1)];
    }
  else
    for (int i = 0; i < m; i++) {
      ta = cb[i][0][y[0 + ((i & 1) << 0)]] + cb[i][1][y[2 + ((i & 1) << 0)]];
      tb = cb[i][0][y[2 + ((i & 1) << 0)]] + cb[i][1][y[0 + ((i & 1) << 0)]];
      if (ta > tb)
        for (int j = 0; j < n; j++)
          ans[j][i] = (j & 1) ? y[2 + ((i & 1) << 0)] : y[0 + ((i & 1) << 0)];
      else
        for (int j = 0; j < n; j++)
          ans[j][i] = (j & 1) ? y[0 + ((i & 1) << 0)] : y[2 + ((i & 1) << 0)];
    }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) printf("%c", bbb[ans[i][j]]);
    puts("");
  }
  return 0;
}
