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>
long long int const MOD = 1000000007;
long long int const N = 1000005;
long long int const LN = 20;
long long int const inf = 8e18;
using namespace std;
long long int n, m, a[N];
string str[N];
char ch[6];
string ok[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  for (long long int i = 1; i <= n; i++)
    cin >> str[i], str[i] = " " + str[i], ok[i] = str[i];
  ch[1] = 'A';
  ch[2] = 'G';
  ch[3] = 'C';
  ch[4] = 'T';
  long long int ans = inf;
  for (long long int i1 = 1; i1 <= 4; i1++) {
    for (long long int i2 = i1 + 1; i2 <= 4; i2++) {
      long long int temp = 0;
      long long int i3, i4;
      for (long long int j = 1; j <= 4; j++)
        if (j != i1 && j != i2) i3 = j;
      for (long long int j = 1; j <= 4; j++)
        if (j != i1 && j != i2 && j != i3) i4 = j;
      for (long long int i = 1; i <= n; i++) {
        long long int curr[5] = {0};
        long long int cnt[5] = {0};
        curr[1] = i1;
        curr[2] = i2;
        curr[3] = i3;
        curr[4] = i4;
        for (long long int j = 1; j <= m; j++) {
          if (i % 2 == 0) {
            if (str[i][j] != ch[curr[1]]) cnt[1]++;
            if (str[i][j] != ch[curr[2]]) cnt[2]++;
            swap(curr[1], curr[2]);
          } else {
            if (str[i][j] != ch[curr[3]]) cnt[3]++;
            if (str[i][j] != ch[curr[4]]) cnt[4]++;
            swap(curr[4], curr[3]);
          }
        }
        temp += min(cnt[1], cnt[2]) + min(cnt[3], cnt[4]);
      }
      ans = min(ans, temp);
    }
  }
  for (long long int i1 = 1; i1 <= 4; i1++) {
    for (long long int i2 = i1 + 1; i2 <= 4; i2++) {
      long long int temp = 0;
      long long int i3, i4;
      for (long long int j = 1; j <= 4; j++)
        if (j != i1 && j != i2) i3 = j;
      for (long long int j = 1; j <= 4; j++)
        if (j != i1 && j != i2 && j != i3) i4 = j;
      for (long long int i = 1; i <= m; i++) {
        long long int curr[5] = {0};
        long long int cnt[5] = {0};
        curr[1] = i1;
        curr[2] = i2;
        curr[3] = i3;
        curr[4] = i4;
        for (long long int j = 1; j <= n; j++) {
          if (i % 2 == 0) {
            if (str[j][i] != ch[curr[1]]) cnt[1]++;
            if (str[j][i] != ch[curr[2]]) cnt[2]++;
            swap(curr[1], curr[2]);
          } else {
            if (str[j][i] != ch[curr[3]]) cnt[3]++;
            if (str[j][i] != ch[curr[4]]) cnt[4]++;
            swap(curr[4], curr[3]);
          }
        }
        temp += min(cnt[1], cnt[2]) + min(cnt[3], cnt[4]);
      }
      ans = min(ans, temp);
    }
  }
  for (long long int i1 = 1; i1 <= 4; i1++) {
    for (long long int i2 = i1 + 1; i2 <= 4; i2++) {
      long long int temp = 0;
      long long int i3, i4;
      for (long long int j = 1; j <= 4; j++)
        if (j != i1 && j != i2) i3 = j;
      for (long long int j = 1; j <= 4; j++)
        if (j != i1 && j != i2 && j != i3) i4 = j;
      for (long long int i = 1; i <= n; i++) {
        long long int curr[5] = {0};
        long long int cnt[5] = {0};
        curr[1] = i1;
        curr[2] = i2;
        curr[3] = i3;
        curr[4] = i4;
        for (long long int j = 1; j <= m; j++) {
          if (i % 2 == 0) {
            if (str[i][j] != ch[curr[1]]) cnt[1]++;
            if (str[i][j] != ch[curr[2]]) cnt[2]++;
            swap(curr[1], curr[2]);
          } else {
            if (str[i][j] != ch[curr[3]]) cnt[3]++;
            if (str[i][j] != ch[curr[4]]) cnt[4]++;
            swap(curr[4], curr[3]);
          }
        }
        if (i % 2) {
          if (cnt[3] > cnt[4]) {
            for (long long int j = 1; j <= m; j++) {
              if (j % 2)
                ok[i][j] = ch[i4];
              else
                ok[i][j] = ch[i3];
            }
          } else {
            for (long long int j = 1; j <= m; j++) {
              if (j % 2)
                ok[i][j] = ch[i3];
              else
                ok[i][j] = ch[i4];
            }
          }
        } else {
          if (cnt[1] > cnt[2]) {
            for (long long int j = 1; j <= m; j++) {
              if (j % 2)
                ok[i][j] = ch[i2];
              else
                ok[i][j] = ch[i1];
            }
          } else {
            for (long long int j = 1; j <= m; j++) {
              if (j % 2)
                ok[i][j] = ch[i1];
              else
                ok[i][j] = ch[i2];
            }
          }
        }
        temp += min(cnt[1], cnt[2]) + min(cnt[3], cnt[4]);
      }
      if (temp == ans) {
        for (long long int i = 1; i <= n; i++) {
          for (long long int j = 1; j <= m; j++) cout << ok[i][j];
          cout << '\n';
        }
        return 0;
      }
    }
  }
  for (long long int i1 = 1; i1 <= 4; i1++) {
    for (long long int i2 = i1 + 1; i2 <= 4; i2++) {
      long long int temp = 0;
      long long int i3, i4;
      for (long long int j = 1; j <= 4; j++)
        if (j != i1 && j != i2) i3 = j;
      for (long long int j = 1; j <= 4; j++)
        if (j != i1 && j != i2 && j != i3) i4 = j;
      for (long long int i = 1; i <= m; i++) {
        long long int curr[5] = {0};
        long long int cnt[5] = {0};
        curr[1] = i1;
        curr[2] = i2;
        curr[3] = i3;
        curr[4] = i4;
        for (long long int j = 1; j <= n; j++) {
          if (i % 2 == 0) {
            if (str[j][i] != ch[curr[1]]) cnt[1]++;
            if (str[j][i] != ch[curr[2]]) cnt[2]++;
            swap(curr[1], curr[2]);
          } else {
            if (str[j][i] != ch[curr[3]]) cnt[3]++;
            if (str[j][i] != ch[curr[4]]) cnt[4]++;
            swap(curr[4], curr[3]);
          }
        }
        if (i % 2) {
          if (cnt[3] > cnt[4]) {
            for (long long int j = 1; j <= n; j++) {
              if (j % 2)
                ok[j][i] = ch[i4];
              else
                ok[j][i] = ch[i3];
            }
          } else {
            for (long long int j = 1; j <= n; j++) {
              if (j % 2)
                ok[j][i] = ch[i3];
              else
                ok[j][i] = ch[i4];
            }
          }
        } else {
          if (cnt[1] > cnt[2]) {
            for (long long int j = 1; j <= n; j++) {
              if (j % 2)
                ok[j][i] = ch[i2];
              else
                ok[j][i] = ch[i1];
            }
          } else {
            for (long long int j = 1; j <= n; j++) {
              if (j % 2)
                ok[j][i] = ch[i1];
              else
                ok[j][i] = ch[i2];
            }
          }
        }
        temp += min(cnt[1], cnt[2]) + min(cnt[3], cnt[4]);
      }
      if (temp == ans) {
        for (long long int i = 1; i <= n; i++) {
          for (long long int j = 1; j <= m; j++) cout << ok[i][j];
          cout << '\n';
        }
        return 0;
      }
    }
  }
  return 0;
}
