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>
const long long MAX_N = 3e5 + 10;
const long long MOD = 1e9 + 7;
using namespace std;
vector<int> t[MAX_N];
vector<int> table[MAX_N];
vector<int> temp[MAX_N];
int a[10];
int n, m;
void out(int x) {
  if (x == 1)
    cout << 'A';
  else if (x == 2)
    cout << 'T';
  else if (x == 3)
    cout << 'C';
  else
    cout << 'G';
}
void update() {
  for (int i = 1; i <= n; ++i) {
    table[i].clear();
    for (auto x : temp[i]) table[i].push_back(x);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    string s;
    cin >> s;
    for (int j = 0; j < m; ++j) {
      if (s[j] == 'A')
        t[i].push_back(1);
      else if (s[j] == 'T')
        t[i].push_back(2);
      else if (s[j] == 'C')
        t[i].push_back(3);
      else
        t[i].push_back(4);
    }
  }
  cout << "\n";
  for (int i = 1; i <= 4; ++i) a[i - 1] = i;
  long long ans = 1e18;
  do {
    long long sum = 0;
    for (int i = 1; i <= n; ++i) temp[i].clear();
    for (int i = 1; i <= n; ++i) {
      int now1, now2;
      int sm;
      int c1 = 0, c2 = 0;
      if (i % 2) {
        sm = a[0] + a[1];
        now1 = a[0];
        now2 = a[1];
      } else {
        sm = a[2] + a[3];
        now1 = a[2];
        now2 = a[3];
      }
      for (int j = 0; j < m; ++j) {
        c1 += (now1 != t[i][j]);
        c2 += (now2 != t[i][j]);
        now1 = sm - now1;
        now2 = sm - now2;
      }
      if (c1 < c2) {
        if (i % 2)
          now1 = a[0];
        else
          now1 = a[2];
        for (int j = 0; j < m; ++j) {
          temp[i].push_back(now1);
          now1 = sm - now1;
        }
      } else {
        if (i % 2)
          now1 = a[1];
        else
          now1 = a[3];
        for (int j = 0; j < m; ++j) {
          temp[i].push_back(now1);
          now1 = sm - now1;
        }
      }
      sum += min(c1, c2);
    }
    if (sum < ans) {
      ans = sum;
      update();
    }
    for (int i = 1; i <= n; ++i) temp[i].clear();
    sum = 0;
    for (int i = 0; i < m; ++i) {
      int now1, now2;
      int sm;
      int c1 = 0, c2 = 0;
      if (i % 2) {
        sm = a[0] + a[1];
        now1 = a[0];
        now2 = a[1];
      } else {
        sm = a[2] + a[3];
        now1 = a[2];
        now2 = a[3];
      }
      for (int j = 1; j <= n; ++j) {
        c1 += (now1 != t[j][i]);
        c2 += (now2 != t[j][i]);
        now1 = sm - now1;
        now2 = sm - now2;
      }
      if (c1 < c2) {
        if (i % 2)
          now1 = a[0];
        else
          now1 = a[2];
        for (int j = 1; j <= n; ++j) {
          temp[j].push_back(now1);
          now1 = sm - now1;
        }
      } else {
        if (i % 2)
          now1 = a[1];
        else
          now1 = a[3];
        for (int j = 1; j <= n; ++j) {
          temp[j].push_back(now1);
          now1 = sm - now1;
        }
      }
      sum += min(c1, c2);
    }
    if (sum < ans) {
      ans = sum;
      update();
    }
  } while (next_permutation(a, a + 4));
  for (int i = 1; i <= n; ++i) {
    for (auto x : table[i]) out(x);
    cout << "\n";
  }
  return 0;
}
