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 MAXn = 3e5 + 10;
string s = "ACGT";
vector<char> ar[MAXn];
int n, m, ans;
string anss;
bool flag;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  ans = n * m + 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      char ch;
      cin >> ch;
      ar[i].push_back(ch);
    }
  }
  do {
    long long ansq = 0;
    int a = 0, b = 2;
    for (int i = 0; i < n; i++) {
      if (i % 2) {
        int ansqq = 0, ansqq2 = 0;
        b = 2;
        for (int j = 0; j < m; j++) {
          if (ar[i][j] != s[b]) {
            ansqq++;
          }
          b++;
          if (b == 4) b = 2;
        }
        b = 3;
        for (int j = 0; j < m; j++) {
          if (ar[i][j] != s[b]) {
            ansqq2++;
          }
          b++;
          if (b == 4) b = 2;
        }
        ansq += min(ansqq, ansqq2);
      } else {
        a = 0;
        int ansqq = 0, ansqq2 = 0;
        for (int j = 0; j < m; j++) {
          if (ar[i][j] != s[a]) {
            ansqq++;
          }
          a++;
          if (a == 2) a = 0;
        }
        a = 1;
        for (int j = 0; j < m; j++) {
          if (ar[i][j] != s[a]) {
            ansqq2++;
          }
          a++;
          if (a == 2) a = 0;
        }
        ansq += min(ansqq, ansqq2);
      }
    }
    if (ansq < ans) {
      anss = s;
      ans = ansq;
      flag = false;
    }
    ansq = 0;
    a = 0;
    b = 2;
    for (int i = 0; i < m; i++) {
      if (i % 2) {
        int ansqq = 0, ansqq2 = 0;
        b = 2;
        for (int j = 0; j < n; j++) {
          if (ar[j][i] != s[b]) {
            ansqq++;
          }
          b++;
          if (b == 4) b = 2;
        }
        b = 3;
        for (int j = 0; j < n; j++) {
          if (ar[j][i] != s[b]) {
            ansqq2++;
          }
          b++;
          if (b == 4) b = 2;
        }
        ansq += min(ansqq, ansqq2);
      } else {
        a = 0;
        int ansqq = 0, ansqq2 = 0;
        for (int j = 0; j < n; j++) {
          if (ar[j][i] != s[a]) {
            ansqq++;
          }
          a++;
          if (a == 2) a = 0;
        }
        a = 1;
        for (int j = 0; j < n; j++) {
          if (ar[j][i] != s[a]) {
            ansqq2++;
          }
          a++;
          if (a == 2) a = 0;
        }
        ansq += min(ansqq, ansqq2);
      }
    }
    if (ansq < ans) {
      anss = s;
      ans = ansq;
      flag = true;
    }
  } while (next_permutation(s.begin(), s.end()));
  if (flag) {
    s = anss;
    int a = 0, b = 2;
    for (int i = 0; i < m; i++) {
      if (i % 2) {
        int ansqq = 0, ansqq2 = 0;
        b = 2;
        for (int j = 0; j < n; j++) {
          if (ar[j][i] != s[b]) {
            ansqq++;
          }
          b++;
          if (b == 4) b = 2;
        }
        b = 3;
        for (int j = 0; j < n; j++) {
          if (ar[j][i] != s[b]) {
            ansqq2++;
          }
          b++;
          if (b == 4) b = 2;
        }
        if (ansqq < ansqq2) {
          b = 2;
          for (int j = 0; j < n; j++) {
            ar[j][i] = s[b];
            b++;
            if (b == 4) b = 2;
          }
        } else {
          b = 3;
          for (int j = 0; j < n; j++) {
            ar[j][i] = s[b];
            b++;
            if (b == 4) b = 2;
          }
        }
      } else {
        a = 0;
        int ansqq = 0, ansqq2 = 0;
        for (int j = 0; j < n; j++) {
          if (ar[j][i] != s[a]) {
            ansqq++;
          }
          a++;
          if (a == 2) a = 0;
        }
        a = 1;
        for (int j = 0; j < n; j++) {
          if (ar[j][i] != s[a]) {
            ansqq2++;
          }
          a++;
          if (a == 2) a = 0;
        }
        if (ansqq < ansqq2) {
          a = 0;
          for (int j = 0; j < n; j++) {
            ar[j][i] = s[a];
            a++;
            if (a == 2) a = 0;
          }
        } else {
          a = 1;
          for (int j = 0; j < n; j++) {
            ar[j][i] = s[a];
            a++;
            if (a == 2) a = 0;
          }
        }
      }
    }
  } else {
    s = anss;
    int a = 0, b = 2;
    for (int i = 0; i < n; i++) {
      if (i % 2) {
        int ansqq = 0, ansqq2 = 0;
        b = 2;
        for (int j = 0; j < m; j++) {
          if (ar[i][j] != s[b]) {
            ansqq++;
          }
          b++;
          if (b == 4) b = 2;
        }
        b = 3;
        for (int j = 0; j < m; j++) {
          if (ar[i][j] != s[b]) {
            ansqq2++;
          }
          b++;
          if (b == 4) b = 2;
        }
        if (ansqq < ansqq2) {
          b = 2;
          for (int j = 0; j < m; j++) {
            ar[i][j] = s[b];
            b++;
            if (b == 4) b = 2;
          }
        } else {
          b = 3;
          for (int j = 0; j < m; j++) {
            ar[i][j] = s[b];
            b++;
            if (b == 4) b = 2;
          }
        }
      } else {
        a = 0;
        int ansqq = 0, ansqq2 = 0;
        for (int j = 0; j < m; j++) {
          if (ar[i][j] != s[a]) {
            ansqq++;
          }
          a++;
          if (a == 2) a = 0;
        }
        a = 1;
        for (int j = 0; j < m; j++) {
          if (ar[i][j] != s[a]) {
            ansqq2++;
          }
          a++;
          if (a == 2) a = 0;
        }
        if (ansqq < ansqq2) {
          a = 0;
          for (int j = 0; j < m; j++) {
            ar[i][j] = s[a];
            a++;
            if (a == 2) a = 0;
          }
        } else {
          a = 1;
          for (int j = 0; j < m; j++) {
            ar[i][j] = s[a];
            a++;
            if (a == 2) a = 0;
          }
        }
      }
    }
  }
  for (int i = 0; i < n; i++, cout << endl)
    for (int j = 0; j < m; j++) cout << ar[i][j];
}
