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 n, m;
char mat[300005];
char mat1[300005];
char mat2[300005];
char matans[300005];
bool satir;
char matt1[300005];
char matt2[300005];
long long ansmin = 3000000;
void f(char c1, char c2, char c3, char c4) {
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int ans1 = 0;
    int ans2 = 0;
    for (int j = 0; j < m; j++) {
      if (i % 2 == 0) {
        if (j % 2 == 0) {
          if (mat[i * m + j] != c1) ans1++;
          matt1[i * m + j] = c1;
          if (mat[i * m + j] != c2) ans2++;
          matt2[i * m + j] = c2;
        } else {
          if (mat[i * m + j] != c1) ans2++;
          matt2[i * m + j] = c1;
          if (mat[i * m + j] != c2) ans1++;
          matt1[i * m + j] = c2;
        }
      } else {
        if (j % 2 == 0) {
          if (mat[i * m + j] != c3) ans1++;
          matt1[i * m + j] = c3;
          if (mat[i * m + j] != c4) ans2++;
          matt2[i * m + j] = c4;
        } else {
          if (mat[i * m + j] != c3) ans2++;
          matt2[i * m + j] = c3;
          if (mat[i * m + j] != c4) ans1++;
          matt1[i * m + j] = c4;
        }
      }
    }
    if (ans2 < ans1) {
      for (int j = 0; j < m; j++) {
        int tmp = matt1[i * m + j];
        matt1[i * m + j] = matt2[i * m + j];
        matt2[i * m + j] = tmp;
      }
    }
    ans += min(ans1, ans2);
  }
  if (ans < ansmin) {
    ansmin = ans;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matans[i * m + j] = matt1[i * m + j];
      }
    }
  }
  ans = 0;
  for (int j = 0; j < m; j++) {
    int ans1 = 0;
    int ans2 = 0;
    for (int i = 0; i < n; i++) {
      if (j % 2 == 0) {
        if (i % 2 == 0) {
          if (mat[i * m + j] != c1) ans1++;
          matt1[i * m + j] = c1;
          if (mat[i * m + j] != c2) ans2++;
          matt2[i * m + j] = c2;
        } else {
          if (mat[i * m + j] != c1) ans2++;
          matt2[i * m + j] = c1;
          if (mat[i * m + j] != c2) ans1++;
          matt1[i * m + j] = c2;
        }
      } else {
        if (i % 2 == 0) {
          if (mat[i * m + j] != c3) ans1++;
          matt1[i * m + j] = c3;
          if (mat[i * m + j] != c4) ans2++;
          matt2[i * m + j] = c4;
        } else {
          if (mat[i * m + j] != c3) ans2++;
          matt2[i * m + j] = c3;
          if (mat[i * m + j] != c4) ans1++;
          matt1[i * m + j] = c4;
        }
      }
    }
    if (ans2 < ans1) {
      for (int i = 0; i < n; i++) {
        int tmp = matt1[i * m + j];
        matt1[i * m + j] = matt2[i * m + j];
        matt2[i * m + j] = tmp;
      }
    }
    ans += min(ans1, ans2);
  }
  if (ans < ansmin) {
    ansmin = ans;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matans[i * m + j] = matt1[i * m + j];
      }
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> mat[i * m + j];
  f('A', 'G', 'C', 'T');
  f('A', 'C', 'T', 'G');
  f('A', 'T', 'C', 'G');
  f('G', 'C', 'A', 'T');
  f('G', 'T', 'A', 'C');
  f('C', 'T', 'A', 'G');
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cout << matans[i * m + j];
    }
    cout << endl;
  }
  cout << endl;
}
