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;
long long int power[6] = {0};
map<char, long long int> mp;
map<long long int, char> inv;
pair<long long int, long long int> ok(long long int j) {
  long long int cnt = 0;
  for (long long int i = 0; i <= 3; i++) {
    if (power[i] & j) cnt++;
  }
  if (cnt != 2) {
    return {-1, -1};
  }
  pair<long long int, long long int> p = {-1, -1};
  for (long long int i = 0; i <= 3; i++) {
    if (power[i] & j) {
      if (p.first == -1) {
        p.first = i + 1;
      } else {
        p.second = i + 1;
      }
    }
  }
  return p;
}
void solve() {
  long long int n, m;
  cin >> n >> m;
  vector<vector<long long int>> v(n, vector<long long int>(m));
  for (long long int j = 0; j < n; j++) {
    string s;
    cin >> s;
    for (long long int i = 0; i < m; i++) {
      v[j][i] = mp[s[i]];
    }
  }
  vector<pair<long long int, pair<long long int, long long int>>> rows;
  vector<pair<long long int, pair<long long int, long long int>>> cols;
  for (long long int j = 3; j <= 12; j++) {
    pair<long long int, long long int> p1 = ok(j);
    pair<long long int, long long int> p2 = {0, 0};
    for (long long int j = 1; j <= 4; j++) {
      if (p1.first != j && p1.second != j) {
        if (p2.first)
          p2.second = j;
        else
          p2.first = j;
      }
    }
    long long int mn = 0;
    if (p1.first != -1) {
      for (long long int j = 0; j < n; j++) {
        long long int mn1 = 0;
        long long int mn2 = 0;
        if (j % 2 == 0) {
          for (long long int i = 0; i < m; i++) {
            if (i % 2 == 0) {
              if (v[j][i] != p1.first) mn1++;
              if (v[j][i] != p1.second) mn2++;
            } else {
              if (v[j][i] != p1.second) mn1++;
              if (v[j][i] != p1.first) mn2++;
            }
          }
        } else {
          for (long long int i = 0; i < m; i++) {
            if (i % 2 == 0) {
              if (v[j][i] != p2.first) mn1++;
              if (v[j][i] != p2.second) mn2++;
            } else {
              if (v[j][i] != p2.second) mn1++;
              if (v[j][i] != p2.first) mn2++;
            }
          }
        }
        mn += min(mn1, mn2);
      }
      rows.push_back({mn, p1});
    }
  }
  for (long long int j = 3; j <= 12; j++) {
    pair<long long int, long long int> p1 = ok(j);
    pair<long long int, long long int> p2 = {0, 0};
    for (long long int j = 1; j <= 4; j++) {
      if (p1.first != j && p1.second != j) {
        if (p2.first)
          p2.second = j;
        else
          p2.first = j;
      }
    }
    long long int mn = 0;
    if (p1.first != -1) {
      for (long long int j = 0; j < m; j++) {
        long long int mn1 = 0;
        long long int mn2 = 0;
        if (j % 2 == 0) {
          for (long long int i = 0; i < n; i++) {
            if (i % 2 == 0) {
              if (v[i][j] != p1.first) mn1++;
              if (v[i][j] != p1.second) mn2++;
            } else {
              if (v[i][j] != p1.second) mn1++;
              if (v[i][j] != p1.first) mn2++;
            }
          }
        } else {
          for (long long int i = 0; i < n; i++) {
            if (i % 2 == 0) {
              if (v[i][j] != p2.first) mn1++;
              if (v[i][j] != p2.second) mn2++;
            } else {
              if (v[i][j] != p2.second) mn1++;
              if (v[i][j] != p2.first) mn2++;
            }
          }
        }
        mn += min(mn1, mn2);
      }
      cols.push_back({mn, p1});
    }
  }
  sort(rows.begin(), rows.end());
  sort(cols.begin(), cols.end());
  vector<vector<long long int>> ans(n, vector<long long int>(m));
  cout << "\n";
  if (rows[0].first < cols[0].first) {
    pair<long long int, long long int> p1 = rows[0].second;
    pair<long long int, long long int> p2 = {0, 0};
    for (long long int j = 1; j <= 4; j++) {
      if (p1.first != j && p1.second != j) {
        if (p2.first)
          p2.second = j;
        else
          p2.first = j;
      }
    }
    if (p1.first != -1) {
      for (long long int j = 0; j < n; j++) {
        long long int mn1 = 0;
        long long int mn2 = 0;
        if (j % 2 == 0) {
          for (long long int i = 0; i < m; i++) {
            if (i % 2 == 0) {
              if (v[j][i] != p1.first) mn1++;
              if (v[j][i] != p1.second) mn2++;
            } else {
              if (v[j][i] != p1.second) mn1++;
              if (v[j][i] != p1.first) mn2++;
            }
          }
        } else {
          for (long long int i = 0; i < m; i++) {
            if (i % 2 == 0) {
              if (v[j][i] != p2.first) mn1++;
              if (v[j][i] != p2.second) mn2++;
            } else {
              if (v[j][i] != p2.second) mn1++;
              if (v[j][i] != p2.first) mn2++;
            }
          }
        }
        if (mn1 < mn2) {
          if (j % 2 == 0) {
            for (long long int i = 0; i < m; i++) {
              if (i % 2 == 0) {
                ans[j][i] = p1.first;
              } else {
                ans[j][i] = p1.second;
              }
            }
          } else {
            for (long long int i = 0; i < m; i++) {
              if (i % 2 == 0) {
                ans[j][i] = p2.first;
              } else {
                ans[j][i] = p2.second;
              }
            }
          }
        } else {
          if (j % 2 == 0) {
            for (long long int i = 0; i < m; i++) {
              if (i % 2 == 0) {
                ans[j][i] = p1.second;
              } else {
                ans[j][i] = p1.first;
              }
            }
          } else {
            for (long long int i = 0; i < m; i++) {
              if (i % 2 == 0) {
                ans[j][i] = p2.second;
              } else {
                ans[j][i] = p2.first;
              }
            }
          }
        }
      }
    }
  } else {
    pair<long long int, long long int> p1 = cols[0].second;
    pair<long long int, long long int> p2 = {0, 0};
    for (long long int j = 1; j <= 4; j++) {
      if (p1.first != j && p1.second != j) {
        if (p2.first)
          p2.second = j;
        else
          p2.first = j;
      }
    }
    if (p1.first != -1) {
      for (long long int j = 0; j < m; j++) {
        long long int mn1 = 0;
        long long int mn2 = 0;
        if (j % 2 == 0) {
          for (long long int i = 0; i < n; i++) {
            if (i % 2 == 0) {
              if (v[i][j] != p1.first) mn1++;
              if (v[i][j] != p1.second) mn2++;
            } else {
              if (v[i][j] != p1.second) mn1++;
              if (v[i][j] != p1.first) mn2++;
            }
          }
        } else {
          for (long long int i = 0; i < n; i++) {
            if (i % 2 == 0) {
              if (v[i][j] != p2.first) mn1++;
              if (v[i][j] != p2.second) mn2++;
            } else {
              if (v[i][j] != p2.second) mn1++;
              if (v[i][j] != p2.first) mn2++;
            }
          }
        }
        if (mn1 < mn2) {
          if (j % 2 == 0) {
            for (long long int i = 0; i < n; i++) {
              if (i % 2 == 0) {
                ans[i][j] = p1.first;
              } else {
                ans[i][j] = p1.second;
              }
            }
          } else {
            for (long long int i = 0; i < n; i++) {
              if (i % 2 == 0) {
                ans[i][j] = p2.first;
              } else {
                ans[i][j] = p2.second;
              }
            }
          }
        } else {
          if (j % 2 == 0) {
            for (long long int i = 0; i < n; i++) {
              if (i % 2 == 0) {
                ans[i][j] = p1.second;
              } else {
                ans[i][j] = p1.first;
              }
            }
          } else {
            for (long long int i = 0; i < n; i++) {
              if (i % 2 == 0) {
                ans[i][j] = p2.second;
              } else {
                ans[i][j] = p2.first;
              }
            }
          }
        }
      }
    }
  }
  long long int cnt = 0;
  for (long long int j = 0; j < n; j++) {
    for (long long int i = 0; i < m; i++) {
      if (ans[j][i] != v[j][i]) cnt++;
      cout << inv[ans[j][i]];
    }
    cout << "\n";
  }
  return;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  t = 1;
  mp['A'] = 1;
  mp['G'] = 2;
  mp['C'] = 3;
  mp['T'] = 4;
  inv[1] = 'A';
  inv[2] = 'G';
  inv[3] = 'C';
  inv[4] = 'T';
  power[0] = 1;
  power[1] = 2;
  power[2] = 4;
  power[3] = 8;
  while (t--) {
    solve();
  }
  return 0;
}
