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 main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  char c[6][2];
  char s[4] = {'A', 'C', 'G', 'T'};
  int k = 0;
  for (int i = 0; i < 4; ++i) {
    for (int j = i + 1; j < 4; ++j) {
      c[k][0] = s[i];
      c[k][1] = s[j];
      k++;
    }
  }
  int m, n;
  cin >> n >> m;
  vector<string> v(n);
  for (int l = 0; l < n; ++l) {
    cin >> v[l];
  }
  int l;
  int min_ = 1 << 30;
  for (int i = 0; i < 6; ++i) {
    string s1 = "";
    string s2 = "";
    for (int j = 0; j < m; ++j) {
      s1 += c[i][j % 2];
      s2 += c[i][(j + 1) % 2];
    }
    string s3 = "";
    string s4 = "";
    for (int j = 0; j < m; ++j) {
      s3 += c[5 - i][j % 2];
      s4 += c[5 - i][(j + 1) % 2];
    }
    int dist = 0;
    for (int i1 = 0; i1 < n; ++i1) {
      int d1, d2;
      d1 = d2 = 0;
      for (int j = 0; j < m; ++j) {
        if (i1 % 2 == 0) {
          if (v[i1][j] != s1[j]) d1++;
          if (v[i1][j] != s2[j]) d2++;
        } else {
          if (v[i1][j] != s3[j]) d1++;
          if (v[i1][j] != s4[j]) d2++;
        }
      }
      dist += min(d1, d2);
    }
    if (dist < min_) {
      min_ = dist;
      l = i;
    }
  }
  int l1;
  int min1 = 1 << 30;
  for (int i = 0; i < 6; ++i) {
    string s1 = "";
    string s2 = "";
    for (int j = 0; j < n; ++j) {
      s1 += c[i][j % 2];
      s2 += c[i][(j + 1) % 2];
    }
    string s3 = "";
    string s4 = "";
    for (int j = 0; j < n; ++j) {
      s3 += c[5 - i][j % 2];
      s4 += c[5 - i][(j + 1) % 2];
    }
    int dist = 0;
    for (int i1 = 0; i1 < m; ++i1) {
      int d1, d2;
      d1 = d2 = 0;
      for (int j = 0; j < n; ++j) {
        if (i1 % 2 == 0) {
          if (v[j][i1] != s1[j]) d1++;
          if (v[j][i1] != s2[j]) d2++;
        } else {
          if (v[j][i1] != s3[j]) d1++;
          if (v[j][i1] != s4[j]) d2++;
        }
      }
      dist += min(d1, d2);
    }
    if (dist < min1) {
      min1 = dist;
      l1 = i;
    }
  }
  if (min_ < min1) {
    string s1 = "";
    string s2 = "";
    for (int j = 0; j < m; ++j) {
      s1 += c[l][j % 2];
      s2 += c[l][(j + 1) % 2];
    }
    string s3 = "";
    string s4 = "";
    for (int j = 0; j < m; ++j) {
      s3 += c[5 - l][j % 2];
      s4 += c[5 - l][(j + 1) % 2];
    }
    int dist = 0;
    for (int i1 = 0; i1 < n; ++i1) {
      int d1, d2;
      d1 = d2 = 0;
      for (int j = 0; j < m; ++j) {
        if (i1 % 2 == 0) {
          if (v[i1][j] != s1[j]) d1++;
          if (v[i1][j] != s2[j]) d2++;
        } else {
          if (v[i1][j] != s3[j]) d1++;
          if (v[i1][j] != s4[j]) d2++;
        }
      }
      if (d1 < d2) {
        for (int j = 0; j < m; ++j) {
          if (i1 % 2 == 0)
            v[i1][j] = s1[j];
          else
            v[i1][j] = s3[j];
        }
      } else {
        for (int j = 0; j < m; ++j) {
          if (i1 % 2 == 0)
            v[i1][j] = s2[j];
          else
            v[i1][j] = s4[j];
        }
      }
    }
  } else {
    string s1 = "";
    string s2 = "";
    for (int j = 0; j < n; ++j) {
      s1 += c[l1][j % 2];
      s2 += c[l1][(j + 1) % 2];
    }
    string s3 = "";
    string s4 = "";
    for (int j = 0; j < n; ++j) {
      s3 += c[5 - l1][j % 2];
      s4 += c[5 - l1][(j + 1) % 2];
    }
    int dist = 0;
    for (int i1 = 0; i1 < m; ++i1) {
      int d1, d2;
      d1 = d2 = 0;
      for (int j = 0; j < n; ++j) {
        if (i1 % 2 == 0) {
          if (v[j][i1] != s1[j]) d1++;
          if (v[j][i1] != s2[j]) d2++;
        } else {
          if (v[j][i1] != s3[j]) d1++;
          if (v[j][i1] != s4[j]) d2++;
        }
      }
      if (d1 < d2) {
        for (int j = 0; j < n; ++j) {
          if (i1 % 2 == 0)
            v[j][i1] = s1[j];
          else
            v[j][i1] = s3[j];
        }
      } else {
        for (int j = 0; j < n; ++j) {
          if (i1 % 2 == 0)
            v[j][i1] = s2[j];
          else
            v[j][i1] = s4[j];
        }
      }
    }
  }
  for (int j1 = 0; j1 < n; ++j1) {
    cout << v[j1] << endl;
  }
}
