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;
void base() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
vector<string> s, ans;
int n, m;
int counth(string ss, int prin) {
  int total = 0;
  for (int i = 0; i < n; ++i) {
    int c1 = 0, c2 = 0;
    for (int j = 0; j < m; ++j) {
      if (~i & 1) {
        if (~j & 1) {
          c1 += (s[i][j] != ss[0]);
          c2 += (s[i][j] != ss[1]);
        } else {
          c1 += (s[i][j] != ss[1]);
          c2 += (s[i][j] != ss[0]);
        }
      } else {
        if (~j & 1) {
          c1 += (s[i][j] != ss[2]);
          c2 += (s[i][j] != ss[3]);
        } else {
          c1 += (s[i][j] != ss[3]);
          c2 += (s[i][j] != ss[2]);
        }
      }
    }
    total += min(c1, c2);
    if (prin == 0) continue;
    if (c1 < c2) {
      if (~i & 1) {
        for (int j = 0; j < m; ++j) {
          if (~j & 1)
            ans[i] += ss[0];
          else
            ans[i] += ss[1];
        }
      } else {
        for (int j = 0; j < m; ++j) {
          if (~j & 1)
            ans[i] += ss[2];
          else
            ans[i] += ss[3];
        }
      }
    } else {
      if (~i & 1) {
        for (int j = 0; j < m; ++j) {
          if (~j & 1)
            ans[i] += ss[1];
          else
            ans[i] += ss[0];
        }
      } else {
        for (int j = 0; j < m; ++j) {
          if (~j & 1)
            ans[i] += ss[3];
          else
            ans[i] += ss[2];
        }
      }
    }
  }
  return total;
}
int countv(string ss, int prin) {
  int total = 0;
  for (int j = 0; j < m; ++j) {
    int c1 = 0, c2 = 0;
    for (int i = 0; i < n; ++i) {
      if (~j & 1) {
        if (~i & 1) {
          c1 += (s[i][j] != ss[0]);
          c2 += (s[i][j] != ss[2]);
        } else {
          c1 += (s[i][j] != ss[2]);
          c2 += (s[i][j] != ss[0]);
        }
      } else {
        if (~i & 1) {
          c1 += (s[i][j] != ss[1]);
          c2 += (s[i][j] != ss[3]);
        } else {
          c1 += (s[i][j] != ss[3]);
          c2 += (s[i][j] != ss[1]);
        }
      }
    }
    total += min(c1, c2);
    if (prin == 0) continue;
    if (c1 < c2) {
      if (~j & 1) {
        for (int i = 0; i < n; ++i) {
          if (~i & 1)
            ans[i] += ss[0];
          else
            ans[i] += ss[2];
        }
      } else {
        for (int i = 0; i < n; ++i) {
          if (~i & 1)
            ans[i] += ss[1];
          else
            ans[i] += ss[3];
        }
      }
    } else {
      if (~j & 1) {
        for (int i = 0; i < n; ++i) {
          if (~i & 1)
            ans[i] += ss[2];
          else
            ans[i] += ss[0];
        }
      } else {
        for (int i = 0; i < n; ++i) {
          if (~i & 1)
            ans[i] += ss[3];
          else
            ans[i] += ss[1];
        }
      }
    }
  }
  return total;
}
void solve() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    string ts;
    cin >> ts;
    s.push_back(ts);
    ans.push_back("");
  }
  string ss = "AGCT";
  int mins = 1e9;
  string sm = ss;
  int hor = 1;
  for (int i = 0; i < ss.size(); ++i)
    for (int j = 0; j < ss.size(); ++j)
      for (int k = 0; k < ss.size(); ++k)
        for (int l = 0; l < ss.size(); ++l) {
          if (i == j || i == k || i == l || j == k || j == l || k == l)
            continue;
          string sc = "";
          sc += ss[i];
          sc += ss[j];
          sc += ss[k];
          sc += ss[l];
          int x = counth(sc, 0);
          int y = countv(sc, 0);
          if (mins > x) {
            mins = x;
            sm = sc;
            hor = 1;
          }
          if (mins > y) {
            mins = y;
            sm = sc;
            hor = 0;
          }
        }
  if (hor) {
    counth(sm, 1);
  } else {
    countv(sm, 1);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cout << ans[i][j];
    }
    cout << "\n";
  }
}
int main() {
  base();
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
