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;
pair<int, vector<vector<int> > > diff(int a, int b, int c, int d, int n, int m,
                                      vector<vector<int> > arr) {
  vector<vector<int> > ans;
  int finans = 0;
  for (int i = 0; i < n; i++) {
    vector<int> curvec;
    if (i % 2 == 0) {
      int ctr1 = 0;
      for (int j = 0; j < m; j++) {
        if (j % 2 == 0 && arr[i][j] != a)
          ctr1++;
        else if (j % 2 != 0 && arr[i][j] != b)
          ctr1++;
      }
      int ctr2 = 0;
      for (int j = 0; j < m; j++) {
        if (j % 2 == 0 && arr[i][j] != b)
          ctr2++;
        else if (j % 2 != 0 && arr[i][j] != a)
          ctr2++;
      }
      if (ctr1 < ctr2) {
        for (int j = 0; j < m; j++) {
          if (j % 2 == 0)
            curvec.push_back(a);
          else if (j % 2 != 0)
            curvec.push_back(b);
        }
      } else {
        for (int j = 0; j < m; j++) {
          if (j % 2 == 0)
            curvec.push_back(b);
          else if (j % 2 != 0)
            curvec.push_back(a);
        }
      }
      finans += min(ctr1, ctr2);
      ans.push_back(curvec);
    } else {
      int ctr1 = 0;
      for (int j = 0; j < m; j++) {
        if (j % 2 == 0 && arr[i][j] != c)
          ctr1++;
        else if (j % 2 != 0 && arr[i][j] != d)
          ctr1++;
      }
      int ctr2 = 0;
      for (int j = 0; j < m; j++) {
        if (j % 2 == 0 && arr[i][j] != d)
          ctr2++;
        else if (j % 2 != 0 && arr[i][j] != c)
          ctr2++;
      }
      if (ctr1 < ctr2) {
        for (int j = 0; j < m; j++) {
          if (j % 2 == 0)
            curvec.push_back(c);
          else if (j % 2 != 0)
            curvec.push_back(d);
        }
      } else {
        for (int j = 0; j < m; j++) {
          if (j % 2 == 0)
            curvec.push_back(d);
          else if (j % 2 != 0)
            curvec.push_back(c);
        }
      }
      finans += min(ctr1, ctr2);
      ans.push_back(curvec);
    }
  }
  vector<vector<int> > ans1;
  int finans1 = 0;
  for (int i = 0; i < n; i++) {
    vector<int> curvec;
    if (i % 2 != 0) {
      int ctr1 = 0;
      for (int j = 0; j < m; j++) {
        if (j % 2 == 0 && arr[i][j] != a)
          ctr1++;
        else if (j % 2 != 0 && arr[i][j] != b)
          ctr1++;
      }
      int ctr2 = 0;
      for (int j = 0; j < m; j++) {
        if (j % 2 == 0 && arr[i][j] != b)
          ctr2++;
        else if (j % 2 != 0 && arr[i][j] != a)
          ctr2++;
      }
      if (ctr1 < ctr2) {
        for (int j = 0; j < m; j++) {
          if (j % 2 == 0)
            curvec.push_back(a);
          else if (j % 2 != 0)
            curvec.push_back(b);
        }
      } else {
        for (int j = 0; j < m; j++) {
          if (j % 2 == 0)
            curvec.push_back(b);
          else if (j % 2 != 0)
            curvec.push_back(a);
        }
      }
      finans1 += min(ctr1, ctr2);
      ans1.push_back(curvec);
    } else {
      int ctr1 = 0;
      for (int j = 0; j < m; j++) {
        if (j % 2 == 0 && arr[i][j] != c)
          ctr1++;
        else if (j % 2 != 0 && arr[i][j] != d)
          ctr1++;
      }
      int ctr2 = 0;
      for (int j = 0; j < m; j++) {
        if (j % 2 == 0 && arr[i][j] != d)
          ctr2++;
        else if (j % 2 != 0 && arr[i][j] != c)
          ctr2++;
      }
      if (ctr1 < ctr2) {
        for (int j = 0; j < m; j++) {
          if (j % 2 == 0)
            curvec.push_back(c);
          else if (j % 2 != 0)
            curvec.push_back(d);
        }
      } else {
        for (int j = 0; j < m; j++) {
          if (j % 2 == 0)
            curvec.push_back(d);
          else if (j % 2 != 0)
            curvec.push_back(c);
        }
      }
      finans1 += min(ctr1, ctr2);
      ans1.push_back(curvec);
    }
  }
  if (finans1 < finans) {
    return make_pair(finans1, ans1);
  } else {
    return make_pair(finans, ans);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<vector<int> > arr, arrinv;
  for (int i = 0; i < n; i++) {
    string str;
    cin >> str;
    vector<int> curvec;
    for (int j = 0; j < m; j++) {
      if (str[j] == 'A') {
        curvec.push_back(0);
      } else if (str[j] == 'T') {
        curvec.push_back(1);
      } else if (str[j] == 'C') {
        curvec.push_back(2);
      } else {
        curvec.push_back(3);
      }
    }
    arr.push_back(curvec);
  }
  pair<int, vector<vector<int> > > ans1 = diff(0, 1, 2, 3, n, m, arr);
  pair<int, vector<vector<int> > > ans2 = diff(0, 2, 1, 3, n, m, arr);
  pair<int, vector<vector<int> > > ans3 = diff(0, 3, 1, 2, n, m, arr);
  int ans = min(ans1.first, min(ans2.first, ans3.first));
  for (int i = 0; i < m; i++) {
    vector<int> curvec;
    for (int j = 0; j < n; j++) {
      curvec.push_back(arr[j][i]);
    }
    arrinv.push_back(curvec);
  }
  pair<int, vector<vector<int> > > ans4 = diff(0, 1, 2, 3, m, n, arrinv);
  pair<int, vector<vector<int> > > ans5 = diff(0, 2, 1, 3, m, n, arrinv);
  pair<int, vector<vector<int> > > ans6 = diff(0, 3, 1, 2, m, n, arrinv);
  int ansinv = min(ans4.first, min(ans5.first, ans6.first));
  if (ans < ansinv) {
    vector<vector<int> > finarr;
    if (ans == ans1.first) {
      finarr = ans1.second;
    } else if (ans == ans2.first) {
      finarr = ans2.second;
    } else {
      finarr = ans3.second;
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (finarr[i][j] == 0) {
          cout << 'A';
        } else if (finarr[i][j] == 1) {
          cout << 'T';
        } else if (finarr[i][j] == 2) {
          cout << 'C';
        } else {
          cout << 'G';
        }
      }
      cout << endl;
    }
  } else {
    vector<vector<int> > finarr;
    if (ansinv == ans4.first) {
      finarr = ans4.second;
    } else if (ansinv == ans5.first) {
      finarr = ans5.second;
    } else {
      finarr = ans6.second;
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (finarr[j][i] == 0) {
          cout << 'A';
        } else if (finarr[j][i] == 1) {
          cout << 'T';
        } else if (finarr[j][i] == 2) {
          cout << 'C';
        } else {
          cout << 'G';
        }
      }
      cout << endl;
    }
  }
}
