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 mod = 998244353;
const int inf = 0x3f3f3f3f;
long long gcd(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
long long ksm(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b & 1) r = (r * a) % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return r;
}
void exgcd(long long a, long long b, long long &x, long long &y, long long &d) {
  if (!b)
    d = a, x = 1, y = 0;
  else
    exgcd(b, a % b, y, x, d), y -= a / b * x;
}
long long inv(long long a, long long p) {
  long long x, y, d;
  exgcd(a, p, x, y, d);
  x = (x % p + p) % p;
  return x;
}
inline int read() {
  char c = getchar();
  int x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
const int maxn = 3e5 + 10;
int n, m, k, t, ans = 1e9, id = 0, best_id, best_type;
string s[maxn];
string ch[maxn];
char h[maxn];
inline void cou(int type) {
  int tmp = 0;
  for (int i = 0; i <= n - 1; i++)
    for (int j = 0; j <= m - 1; j++)
      if (s[i][j] != ch[i][j]) tmp++;
  if (tmp < ans) {
    ans = tmp;
    best_id = id;
    best_type = type;
  }
}
inline int cou_h(int i) {
  int res = 0;
  for (int j = 0; j < m; j++) {
    res += (s[i][j] != h[j]);
  }
  return res;
}
inline int cou_l(int j) {
  int res = 0;
  for (int i = 0; i < n; i++) {
    res += (s[i][j] != h[i]);
  }
  return res;
}
inline void push_h(char a, char b, int n) {
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0)
      h[i] = a;
    else
      h[i] = b;
  }
}
inline void hang(char a, char b, char c, char d) {
  for (int i = 0; i < n; i++) {
    int ans1, ans2;
    if (i % 2 == 0) {
      push_h(a, b, m);
      ans1 = cou_h(i);
      push_h(b, a, m);
      ans2 = cou_h(i);
    } else {
      push_h(c, d, m);
      ans1 = cou_h(i);
      push_h(d, c, m);
      ans2 = cou_h(i);
    }
    if (ans1 > ans2) {
      swap(a, b);
      swap(c, d);
    }
    for (int j = 0; j < m; j++) {
      if (i % 2 == 0) {
        if (j % 2 == 0)
          ch[i][j] = a;
        else
          ch[i][j] = b;
      } else {
        if (j % 2 == 0)
          ch[i][j] = c;
        else
          ch[i][j] = d;
      }
    }
  }
  cou(0);
}
inline void lie(char a, char b, char c, char d) {
  for (int j = 0; j < m; j++) {
    int ans1, ans2;
    if (j % 2 == 0) {
      push_h(a, b, n);
      ans1 = cou_l(j);
      push_h(b, a, n);
      ans2 = cou_l(j);
    } else {
      push_h(c, d, n);
      ans1 = cou_l(j);
      push_h(d, c, n);
      ans2 = cou_l(j);
    }
    if (ans1 > ans2) {
      swap(a, b);
      swap(c, d);
    }
    for (int i = 0; i < n; i++) {
      if (j % 2 == 0) {
        if (i % 2 == 0)
          ch[i][j] = a;
        else
          ch[i][j] = b;
      } else {
        if (i % 2 == 0)
          ch[i][j] = c;
        else
          ch[i][j] = d;
      }
    }
  }
  cou(1);
}
char g[4] = {'A', 'T', 'G', 'C'};
int main() {
  cin >> n >> m;
  for (int i = 0; i <= n - 1; i++) cin >> s[i];
  for (int i = 0; i <= n - 1; i++) ch[i].resize(m + 10);
  int cnt = 0;
  for (int i = 1; i <= 24; i++) {
    id++;
    hang(g[0], g[1], g[2], g[3]);
    lie(g[0], g[1], g[2], g[3]);
    next_permutation(g, g + 4);
  }
  for (int i = 1; i <= 24; i++) {
    if (i == best_id) {
      if (best_type == 0)
        hang(g[0], g[1], g[2], g[3]);
      else
        lie(g[0], g[1], g[2], g[3]);
      break;
    }
    next_permutation(g, g + 4);
  }
  for (int i = 0; i <= n - 1; i++) {
    for (int j = 0; j <= m - 1; j++) cout << ch[i][j];
    cout << "\n";
  }
  return 0;
}
