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 check(vector<char> &ai, string &temp) {
  int res = 0, e = 0;
  for (int i = 0; i < ai.size(); i++, e = 1 - e) {
    res += (temp[e] != ai[i]);
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m, mn = 1e8, now, J, K, e;
  cin >> n >> m;
  vector<vector<char>> a(n, vector<char>(m));
  vector<vector<char>> b(m, vector<char>(n));
  vector<vector<char>> c(n, vector<char>(m, '-'));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
      b[j][i] = a[i][j];
    }
  }
  vector<vector<string>> alf = {{"AC", "CA", "GT", "TG"},
                                {"AT", "TA", "GC", "CG"},
                                {"AG", "GA", "TC", "CT"}};
  for (int k = 0; k < 2; k++) {
    for (int j = 0; j < 6; j++) {
      now = 0;
      for (int i = 0; i + 1 < (k ? n : m); i += 2) {
        int ab = check(k ? a[i] : b[i], alf[j >> 1][0 + ((j & 1) << 1)]);
        int ba = check(k ? a[i] : b[i], alf[j >> 1][1 + ((j & 1) << 1)]);
        int cd =
            check(k ? a[i + 1] : b[i + 1], alf[j >> 1][2 - ((j & 1) << 1)]);
        int dc =
            check(k ? a[i + 1] : b[i + 1], alf[j >> 1][3 - ((j & 1) << 1)]);
        now += min(ab, ba) + min(cd, dc);
      }
      int ab = check(k ? a[n - 1] : b[m - 1], alf[j >> 1][0 + ((j & 1) << 1)]);
      int ba = check(k ? a[n - 1] : b[m - 1], alf[j >> 1][1 + ((j & 1) << 1)]);
      now += (((k ? n : m) % 2) ? min(ab, ba) : 0);
      if (mn > now) {
        mn = now;
        J = j, K = k;
      }
    }
  }
  for (int i = 0; i + 1 < (K ? n : m); i += 2) {
    int ab = check(K ? a[i] : b[i], alf[J >> 1][0 + ((J & 1) << 1)]);
    int ba = check(K ? a[i] : b[i], alf[J >> 1][1 + ((J & 1) << 1)]);
    int cd = check(K ? a[i + 1] : b[i + 1], alf[J >> 1][2 - ((J & 1) << 1)]);
    int dc = check(K ? a[i + 1] : b[i + 1], alf[J >> 1][3 - ((J & 1) << 1)]);
    for (int j = 0, e = 0; j < (K ? m : n); j++, e = 1 - e)
      c[(K ? i : j)][(K ? j : i)] = alf[J >> 1][(ab > ba) + ((J & 1) << 1)][e];
    for (int j = 0, e = 0; j < (K ? m : n); j++, e = 1 - e)
      c[(K ? i + 1 : j)][(K ? j : i + 1)] =
          alf[J >> 1][2 + (cd > dc) - ((J & 1) << 1)][e];
  }
  int ab = check(K ? a[n - 1] : b[m - 1], alf[J >> 1][0 + ((J & 1) << 1)]);
  int ba = check(K ? a[n - 1] : b[m - 1], alf[J >> 1][1 + ((J & 1) << 1)]);
  if ((K ? n : m) % 2) {
    for (int j = 0, e = 0; j < (K ? m : n); j++, e = 1 - e)
      c[(K ? n - 1 : j)][(K ? j : m - 1)] =
          alf[J >> 1][(ab > ba) + ((J & 1) << 1)][e];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cout << c[i][j];
    }
    cout << '\n';
  }
}
