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;
template <typename T>
inline bool upmin(T &x, T y) {
  return y < x ? x = y, 1 : 0;
}
template <typename T>
inline bool upmax(T &x, T y) {
  return x < y ? x = y, 1 : 0;
}
const long double eps = 1e-11;
const long double pi = acos(-1);
const long long oo = 1 << 30;
const long long loo = 1ll << 62;
const long long mods = 1e9 + 7;
const long long MAXN = 600005;
const long long INF = 0x3f3f3f3f;
inline long long read() {
  long long f = 1, x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + (c ^ 48);
    c = getchar();
  }
  return x * f;
}
char st[MAXN];
long long a[MAXN], c[MAXN], b[2][2], n, m, ans = INF, flag;
pair<long long, long long> f[MAXN], F[MAXN];
long long get(long long x, long long y) { return (x - 1) * m + y; }
void print(long long x) {
  if (x == 3) putchar('A');
  if (x == 2) putchar('C');
  if (x == 1) putchar('G');
  if (x == 0) putchar('T');
}
void solve1() {
  long long num = 0;
  for (long long i = 0; i < n; i++) {
    if (a[get(i, 0)] != b[i & 1][0]) num++;
    if (a[get(i, 1)] != b[i & 1][1]) num++;
  }
  for (long long i = 2; i < m; i++) {
    long long p = 0, q = 0;
    for (long long j = 0; j < n; j++) {
      if (a[get(j, i)] != b[j & 1][i & 1]) p++;
      if (a[get(j, i)] != b[(j & 1) ^ 1][i & 1]) q++;
    }
    if (p < q)
      num += p, f[i] = make_pair(b[0][i & 1], b[1][i & 1]);
    else
      num += q, f[i] = make_pair(b[1][i & 1], b[0][i & 1]);
  }
  if (upmin(ans, num)) {
    flag = 0;
    F[0] = make_pair(b[0][0], b[1][0]);
    F[1] = make_pair(b[0][1], b[1][1]);
    for (long long i = 2; i < m; i++) F[i] = f[i];
  }
}
void solve2() {
  long long num = 0;
  for (long long i = 0; i < m; i++) {
    if (a[get(0, i)] != b[0][i & 1]) num++;
    if (a[get(1, i)] != b[1][i & 1]) num++;
  }
  for (long long i = 2; i < n; i++) {
    long long p = 0, q = 0;
    for (long long j = 0; j < m; j++) {
      if (a[get(i, j)] != b[i & 1][j & 1]) p++;
      if (a[get(i, j)] != b[i & 1][(j & 1) ^ 1]) q++;
    }
    if (p < q)
      num += p, f[i] = make_pair(b[i & 1][0], b[i & 1][1]);
    else
      num += q, f[i] = make_pair(b[i & 1][1], b[i & 1][0]);
  }
  if (upmin(ans, num)) {
    flag = 1;
    F[0] = make_pair(b[0][0], b[0][1]);
    F[1] = make_pair(b[1][0], b[1][1]);
    for (long long i = 2; i < n; i++) F[i] = f[i];
  }
}
signed main() {
  n = read(), m = read();
  for (long long i = 0; i < n; i++) {
    scanf("%s", st);
    for (long long j = 0; j < m; j++)
      a[get(i, j)] = (st[j] < 'G') + (st[j] < 'C') + (st[j] < 'T');
  }
  for (long long i = 0; i < 4; i++)
    for (long long j = 0; j < 4; j++)
      for (long long k = 0; k < 4; k++)
        for (long long t = 0; t < 4; t++) {
          if (i == j || i == k || i == t || j == k || j == t || k == t)
            continue;
          b[0][0] = i, b[0][1] = j, b[1][0] = k, b[1][1] = t, solve1(),
          solve2();
        }
  if (!flag) {
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < m; j++)
        if (i & 1)
          print(F[j].second);
        else
          print(F[j].first);
      puts("");
    }
  } else {
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < m; j++)
        if (j & 1)
          print(F[i].second);
        else
          print(F[i].first);
      puts("");
    }
  }
  return 0;
}
