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 score_row(vector<char>& row, char c1, char c2) {
  int score1 = 0;
  int score2 = 0;
  for (int i = 0; i < row.size(); i++) {
    if (i % 2 == 0) {
      if (row[i] != c1) score1++;
      if (row[i] != c2) score2++;
    } else {
      if (row[i] != c2) score1++;
      if (row[i] != c1) score2++;
    }
  }
  return min(score1, score2);
}
int score(vector<vector<char> >& grid, char c1, char c2, char c3, char c4) {
  int n = grid.size();
  int score = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      score += score_row(grid[i], c1, c2);
    } else {
      score += score_row(grid[i], c3, c4);
    }
  }
  return score;
}
void make_best_row(vector<char>& row, char c1, char c2) {
  int score1 = 0;
  int score2 = 0;
  for (int i = 0; i < row.size(); i++) {
    if (i % 2 == 0) {
      if (row[i] != c1) score1++;
      if (row[i] != c2) score2++;
    } else {
      if (row[i] != c2) score1++;
      if (row[i] != c1) score2++;
    }
  }
  for (int i = 0; i < row.size(); i++) {
    if (score1 < score2) {
      if (i % 2 == 0)
        row[i] = c1;
      else
        row[i] = c2;
    } else {
      if (i % 2 == 0)
        row[i] = c2;
      else
        row[i] = c1;
    }
  }
}
void make_best(vector<vector<char> >& grid, char c1, char c2, char c3,
               char c4) {
  int n = grid.size();
  int score = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      make_best_row(grid[i], c1, c2);
    } else {
      make_best_row(grid[i], c3, c4);
    }
  }
}
int score_grid(vector<vector<char> >& grid) {
  int best_score = 400000;
  string best = "****";
  int cur_score;
  cur_score = score(grid, 'A', 'C', 'G', 'T');
  if (cur_score < best_score) {
    best_score = cur_score;
    best = "ACGT";
  }
  cur_score = score(grid, 'A', 'G', 'C', 'T');
  if (cur_score < best_score) {
    best_score = cur_score;
    best = "AGCT";
  }
  cur_score = score(grid, 'A', 'T', 'C', 'G');
  if (cur_score < best_score) {
    best_score = cur_score;
    best = "ATGC";
  }
  cur_score = score(grid, 'C', 'G', 'A', 'T');
  if (cur_score < best_score) {
    best_score = cur_score;
    best = "CGAT";
  }
  cur_score = score(grid, 'C', 'T', 'A', 'G');
  if (cur_score < best_score) {
    best_score = cur_score;
    best = "CTAG";
  }
  cur_score = score(grid, 'G', 'T', 'A', 'C');
  if (cur_score < best_score) {
    best_score = cur_score;
    best = "GTAC";
  }
  make_best(grid, best[0], best[1], best[2], best[3]);
  return best_score;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<char> row(m);
  vector<vector<char> > grid(n, row);
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < m; j++) grid[i][j] = s[j];
  }
  vector<char> trow(n);
  vector<vector<char> > tgrid(m, trow);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) tgrid[j][i] = grid[i][j];
  int score = score_grid(grid);
  int tscore = score_grid(tgrid);
  if (score < tscore) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) cout << grid[i][j];
      cout << endl;
    }
  } else {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) cout << tgrid[j][i];
      cout << endl;
    }
  }
  return 0;
}
