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 inf = 1e9 + 7;
const int maxN = 3e5 + 5;
const int Q = 998244353;
const double eps = 1e-9;
int n, m;
string s[maxN];
struct Cost {
  int cost;
  char a;
  char b;
};
struct Cost rowCost(int row, char a, char b) {
  int ans = 0;
  int ans2 = 0;
  for (int i = 0; i < m; i++) {
    if (i % 2 == 0) {
      ans += (s[row][i] != a);
      ans2 += (s[row][i] != b);
    } else {
      ans += (s[row][i] != b);
      ans2 += (s[row][i] != a);
    }
  }
  if (ans < ans2) {
    return Cost{ans, a, b};
  }
  return Cost{ans2, b, a};
}
struct Cost columnCost(int col, char a, char b) {
  int ans = 0;
  int ans2 = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      ans += (s[i][col] != a);
      ans2 += (s[i][col] != b);
    } else {
      ans += (s[i][col] != b);
      ans2 += (s[i][col] != a);
    }
  }
  if (ans < ans2) {
    return Cost{ans, a, b};
  }
  return Cost{ans2, b, a};
}
int getRowCost(char a, char b, char c, char d) {
  set<char> s = {a, b, c, d};
  if ((int)s.size() != 4) return inf;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      Cost cost = rowCost(i, a, b);
      ans += cost.cost;
    } else {
      Cost cost = rowCost(i, c, d);
      ans += cost.cost;
    }
  }
  return ans;
}
int getColumnCost(char a, char b, char c, char d) {
  set<char> s = {a, b, c, d};
  if ((int)s.size() != 4) return inf;
  int ans = 0;
  for (int i = 0; i < m; i++) {
    if (i % 2 == 0) {
      Cost cost = columnCost(i, a, b);
      ans += cost.cost;
    } else {
      Cost cost = columnCost(i, c, d);
      ans += cost.cost;
    }
  }
  return ans;
}
void newRow(int i, char a, char b) {
  for (int j = 0; j < m; j++) {
    if (j % 2 == 0)
      s[i][j] = a;
    else
      s[i][j] = b;
  }
}
void newColumn(int i, char a, char b) {
  for (int j = 0; j < n; j++) {
    if (j % 2 == 0)
      s[j][i] = a;
    else
      s[j][i] = b;
  }
}
void newColAnswer(vector<char> answer) {
  char a = answer[0];
  char b = answer[1];
  char c = answer[2];
  char d = answer[3];
  for (int i = 0; i < m; i += 2) {
    Cost cost = columnCost(i, a, b);
    newColumn(i, cost.a, cost.b);
  }
  for (int i = 1; i < m; i += 2) {
    Cost cost = columnCost(i, c, d);
    newColumn(i, cost.a, cost.b);
  }
}
void newRowAnswer(vector<char> answer) {
  char a = answer[0];
  char b = answer[1];
  char c = answer[2];
  char d = answer[3];
  for (int i = 0; i < n; i += 2) {
    Cost cost = rowCost(i, a, b);
    newRow(i, cost.a, cost.b);
  }
  for (int i = 1; i < n; i += 2) {
    Cost cost = rowCost(i, c, d);
    newRow(i, cost.a, cost.b);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = (0); i <= ((n)-1); ++i) {
    cin >> s[i];
  }
  int minim = n * m + 1;
  vector<char> answer;
  bool column = false;
  vector<string> t = {"ACGT", "AGCT", "ATCG", "GTAC", "CTAG", "CGAT"};
  for (auto s : t) {
    int x = getRowCost(s[0], s[1], s[2], s[3]);
    if (x < minim) {
      answer = {s[0], s[1], s[2], s[3]};
      minim = x;
      column = false;
    }
    x = getColumnCost(s[0], s[1], s[2], s[3]);
    if (x < minim) {
      answer = {s[0], s[1], s[2], s[3]};
      minim = x;
      column = true;
    }
  }
  if (column)
    newColAnswer(answer);
  else
    newRowAnswer(answer);
  for (int i = (0); i <= ((n)-1); ++i) {
    cout << s[i] << '\n';
  }
  return 0;
}
