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 rr[] = {0, 1, 1, 1, 0, -1, -1, -1};
long long cc[] = {1, 1, 0, -1, -1, -1, 0, 1};
const long long inf = 1e18;
const long long mod = 1e9 + 7;
const long long N = 300050;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long test = 1;
  while (test--) {
    long long n, m;
    cin >> n >> m;
    string s[n], final[n];
    for (long long i = 0; i < n; i++) {
      cin >> s[i];
      final[i] = s[i];
    }
    long long storey[m][2][26], storex[n][2][26];
    memset(storex, 0, sizeof storex);
    memset(storey, 0, sizeof storey);
    for (long long i = 0; i < m; i++) {
      for (long long j = 0; j < n; j++) {
        storey[i][j % 2][s[j][i] - 'A']++;
      }
    }
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < m; j++) {
        storex[i][j % 2][s[i][j] - 'A']++;
      }
    }
    string a = "ACGT";
    function<void(void)> make_ans_y = [&]() {
      for (long long i = 0; i < m; i++) {
        if (i % 2 == 0) {
          long long temp1 = n - n / 2 - storey[i][0][a[0] - 'A'] + n / 2 -
                            storey[i][1][a[2] - 'A'];
          long long temp2 = n - n / 2 - storey[i][0][a[2] - 'A'] + n / 2 -
                            storey[i][1][a[0] - 'A'];
          if (temp1 < temp2) {
            final[0][i] = a[0];
            final[1][i] = a[2];
          } else {
            final[0][i] = a[2];
            final[1][i] = a[0];
          }
        } else {
          long long temp1 = n - n / 2 - storey[i][0][a[1] - 'A'] + n / 2 -
                            storey[i][1][a[3] - 'A'];
          long long temp2 = n - n / 2 - storey[i][0][a[3] - 'A'] + n / 2 -
                            storey[i][1][a[1] - 'A'];
          if (temp1 < temp2) {
            final[0][i] = a[1];
            final[1][i] = a[3];
          } else {
            final[0][i] = a[3];
            final[1][i] = a[1];
          }
        }
      }
      for (long long i = 0; i < m; i++) {
        for (long long j = 2; j < n; j++) {
          final[j][i] = final[j % 2][i];
        }
      }
      return;
    };
    function<void(void)> make_ans_x = [&]() {
      for (long long i = 0; i < n; i++) {
        if (i % 2 == 0) {
          long long temp1 = m - m / 2 - storex[i][0][a[0] - 'A'] + m / 2 -
                            storex[i][1][a[1] - 'A'];
          long long temp2 = m - m / 2 - storex[i][0][a[1] - 'A'] + m / 2 -
                            storex[i][1][a[0] - 'A'];
          if (temp1 < temp2) {
            final[i][0] = a[0];
            final[i][1] = a[1];
          } else {
            final[i][0] = a[1];
            final[i][1] = a[0];
          }
        } else {
          long long temp1 = m - m / 2 - storex[i][0][a[2] - 'A'] + m / 2 -
                            storex[i][1][a[3] - 'A'];
          long long temp2 = m - m / 2 - storex[i][0][a[3] - 'A'] + m / 2 -
                            storex[i][1][a[2] - 'A'];
          if (temp1 < temp2) {
            final[i][0] = a[2];
            final[i][1] = a[3];
          } else {
            final[i][0] = a[3];
            final[i][1] = a[2];
          }
        }
      }
      for (long long i = 0; i < n; i++) {
        for (long long j = 2; j < m; j++) {
          final[i][j] = final[i][j % 2];
        }
      }
      return;
    };
    long long ans = LLONG_MAX;
    do {
      long long tot = 0;
      for (long long i = 0; i < m; i++) {
        if (i % 2 == 0) {
          tot += min(n - n / 2 - storey[i][0][a[0] - 'A'] + n / 2 -
                         storey[i][1][a[2] - 'A'],
                     n - n / 2 - storey[i][0][a[2] - 'A'] + n / 2 -
                         storey[i][1][a[0] - 'A']);
        } else {
          tot += min(n - n / 2 - storey[i][0][a[1] - 'A'] + n / 2 -
                         storey[i][1][a[3] - 'A'],
                     n - n / 2 - storey[i][0][a[3] - 'A'] + n / 2 -
                         storey[i][1][a[1] - 'A']);
        }
      }
      ans = min(ans, tot);
      tot = 0;
      for (long long i = 0; i < n; i++) {
        if (i % 2 == 0) {
          tot += min(m - m / 2 - storex[i][0][a[0] - 'A'] + m / 2 -
                         storex[i][1][a[1] - 'A'],
                     m - m / 2 - storex[i][0][a[1] - 'A'] + m / 2 -
                         storex[i][1][a[0] - 'A']);
        } else {
          tot += min(m - m / 2 - storex[i][0][a[2] - 'A'] + m / 2 -
                         storex[i][1][a[3] - 'A'],
                     m - m / 2 - storex[i][0][a[3] - 'A'] + m / 2 -
                         storex[i][1][a[2] - 'A']);
        }
      }
      ans = min(ans, tot);
    } while (next_permutation(a.begin(), a.end()));
    sort(a.begin(), a.end());
    do {
      long long tot = 0;
      for (long long i = 0; i < m; i++) {
        if (i % 2 == 0) {
          tot += min(n - n / 2 - storey[i][0][a[0] - 'A'] + n / 2 -
                         storey[i][1][a[2] - 'A'],
                     n - n / 2 - storey[i][0][a[2] - 'A'] + n / 2 -
                         storey[i][1][a[0] - 'A']);
        } else {
          tot += min(n - n / 2 - storey[i][0][a[1] - 'A'] + n / 2 -
                         storey[i][1][a[3] - 'A'],
                     n - n / 2 - storey[i][0][a[3] - 'A'] + n / 2 -
                         storey[i][1][a[1] - 'A']);
        }
      }
      if (tot == ans) {
        make_ans_y();
        break;
      }
      tot = 0;
      for (long long i = 0; i < n; i++) {
        if (i % 2 == 0) {
          tot += min(m - m / 2 - storex[i][0][a[0] - 'A'] + m / 2 -
                         storex[i][1][a[1] - 'A'],
                     m - m / 2 - storex[i][0][a[1] - 'A'] + m / 2 -
                         storex[i][1][a[0] - 'A']);
        } else {
          tot += min(m - m / 2 - storex[i][0][a[2] - 'A'] + m / 2 -
                         storex[i][1][a[3] - 'A'],
                     m - m / 2 - storex[i][0][a[3] - 'A'] + m / 2 -
                         storex[i][1][a[2] - 'A']);
        }
      }
      if (tot == ans) {
        make_ans_x();
        break;
      }
    } while (next_permutation(a.begin(), a.end()));
    for (long long i = 0; i < n; i++) {
      cout << final[i] << '\n';
    }
  }
  return 0;
}
