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 n, m;
long long ans;
int os[300001];
int se[300001];
int sol[300001];
void ss(int a, int b, int c, int d) {
  long long va = 0;
  se[0] = a;
  se[m] = b;
  se[2 * m] = c;
  se[1 + m] = d;
  for (int i = 1; i < m; i++) {
    for (int j = 1; j <= 4; j++) {
      if (i != 1 && j != se[(i - 1)] && j != se[(i - 1) + m] &&
          j != se[(i - 1) + 2 * m]) {
        se[i + m] = j;
      }
    }
    for (int j = 1; j <= 4; j++) {
      if (j != se[(i - 1)] && j != se[(i - 1) + m] && j != se[i + m]) {
        se[i] = j;
      }
      if (j != se[(i - 1) + 2 * m] && j != se[(i - 1) + m] && j != se[i + m]) {
        se[i + 2 * m] = j;
      }
    }
  }
  for (int i = 3; i < n; i++) {
    for (int j = 1; j <= 4; j++) {
      if (j != se[(i - 1) * m] && j != se[(i - 1) * m + 1] &&
          j != se[(i - 1) * m + 2]) {
        se[i * m + 1] = j;
      }
    }
    for (int j = 1; j <= 4; j++) {
      if (j != se[(i - 1) * m] && j != se[(i - 1) * m + 1] &&
          j != se[i * m + 1]) {
        se[i * m] = j;
      }
    }
    for (int k = 2; k < m; k++) {
      bool f = true;
      for (int j = 1; j <= 4; j++) {
        if (j != se[i * m + k - 1] && j != se[(i - 1) * m + k] &&
            j != se[(i - 1) * m + (k - 1)] &&
            (k + 1 >= m || j != se[(i - 1) * m + (k + 1)])) {
          se[i * m + k] = j;
          f = false;
        }
      }
      if (f) {
        va = n * m + 1;
        break;
      }
    }
  }
  if (va == 0) {
    for (int i = 0; i < n * m; i++) {
      if (se[i] != os[i]) va++;
    }
  }
  if (va < ans) {
    ans = va;
    for (int i = 0; i < n * m; i++) {
      sol[i] = se[i];
    }
  }
}
void s(int a, int b) {
  int as = a, bs = b;
  int c = 0;
  int d = 0;
  for (int i = 1; i <= 4; i++) {
    if (i != a && i != b) {
      if (c == 0) {
        c = i;
      } else {
        d = i;
      }
    }
  }
  long long va = 0;
  for (int i = 0; i < m; i++) {
    if (i % 2 == 1) {
      a = c;
      b = d;
    }
    long long x = 0;
    long long y = 0;
    for (int j = 0; j < n; j++) {
      if (os[j * m + i] == a && j % 2 == 0) x++;
      if (os[j * m + i] == a && j % 2 == 1) y++;
      if (os[j * m + i] == b && j % 2 == 0) y++;
      if (os[j * m + i] == b && j % 2 == 1) x++;
    }
    if (x >= y) {
      for (int j = 0; j < n; j++) {
        if (j % 2 == 0) {
          se[j * m + i] = a;
        } else {
          se[j * m + i] = b;
        }
      }
    } else {
      for (int j = 0; j < n; j++) {
        if (j % 2 == 0) {
          se[j * m + i] = b;
        } else {
          se[j * m + i] = a;
        }
      }
    }
    if (i % 2 == 1) {
      a = as;
      b = bs;
    }
  }
  for (int i = 0; i < n * m; i++) {
    if (os[i] != se[i]) va++;
  }
  if (va < ans) {
    ans = va;
    for (int i = 0; i < n * m; i++) {
      sol[i] = se[i];
    }
  }
}
void o(int a, int b) {
  int as = a;
  int bs = b;
  int c = 0;
  int d = 0;
  for (int i = 1; i <= 4; i++) {
    if (i != a && i != b) {
      if (c == 0) {
        c = i;
      } else {
        d = i;
      }
    }
  }
  long long va = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 1) {
      a = c;
      b = d;
    }
    long long x = 0;
    long long y = 0;
    for (int j = 0; j < m; j++) {
      if (os[j + i * m] == a && j % 2 == 0) x++;
      if (os[j + i * m] == a && j % 2 == 1) y++;
      if (os[j + i * m] == b && j % 2 == 0) y++;
      if (os[j + i * m] == b && j % 2 == 1) x++;
    }
    if (x >= y) {
      for (int j = 0; j < m; j++) {
        if (j % 2 == 0) {
          se[j + i * m] = a;
        } else {
          se[j + i * m] = b;
        }
      }
    } else {
      for (int j = 0; j < m; j++) {
        if (j % 2 == 0) {
          se[j + i * m] = b;
        } else {
          se[j + i * m] = a;
        }
      }
    }
    if (i % 2 == 1) {
      a = as;
      b = bs;
    }
  }
  for (int i = 0; i < n * m; i++) {
    if (os[i] != se[i]) va++;
  }
  if (va < ans) {
    ans = va;
    for (int i = 0; i < n * m; i++) {
      sol[i] = se[i];
    }
  }
}
void sz(int a, int b) {
  int c = 0;
  int d = 0;
  for (int i = 1; i <= 4; i++) {
    if (i != a && i != b) {
      if (c == 0) {
        c = i;
      } else {
        d = i;
      }
    }
  }
  long long va = 0;
  for (int i = 0; i < m; i++) {
    if (i % 2 == 0) {
      if ((os[i] == a && os[i + m] == b) || (os[i] == b && os[i + m] == a)) {
        se[i] = os[i];
        se[i + m] = os[i + m];
      } else {
        if (os[i] == a || os[i] == b) {
          va++;
          se[i] = os[i];
          if (os[i] == a) {
            se[i + m] = b;
          } else {
            se[i + m] = a;
          }
        } else {
          if (os[i + m] == a || os[i + m] == b) {
            va++;
            se[i + m] = os[i + m];
            if (os[i + m] == a) {
              se[i] = b;
            } else {
              se[i] = a;
            }
          } else {
            va += 2;
            se[i] = a;
            se[i + m] = b;
          }
        }
      }
    } else {
      int as = a;
      int bs = b;
      a = c;
      b = d;
      if ((os[i] == a && os[i + m] == b) || (os[i] == b && os[i + m] == a)) {
        se[i] = os[i];
        se[i + m] = os[i + m];
      } else {
        if (os[i] == a || os[i] == b) {
          va++;
          se[i] = os[i];
          if (os[i] == a) {
            se[i + m] = b;
          } else {
            se[i + m] = a;
          }
        } else {
          if (os[i + m] == a || os[i + m] == b) {
            va++;
            se[i + m] = os[i + m];
            if (os[i + m] == a) {
              se[i] = b;
            } else {
              se[i] = a;
            }
          } else {
            va += 2;
            se[i] = a;
            se[i + m] = b;
          }
        }
      }
      a = as;
      b = bs;
    }
  }
  if (va < ans) {
    ans = va;
    for (int i = 0; i < n * m; i++) {
      sol[i] = se[i];
    }
  }
}
void szb(int a, int b) {
  int c = 0;
  int d = 0;
  for (int i = 1; i <= 4; i++) {
    if (i != a && i != b) {
      if (c == 0) {
        c = i;
      } else {
        d = i;
      }
    }
  }
  long long va = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      if ((os[2 * i] == a && os[2 * i + 1] == b) ||
          (os[2 * i] == b && os[2 * i + 1] == a)) {
        se[2 * i] = os[2 * i];
        se[2 * i + 1] = os[2 * i + 1];
      } else {
        if (os[2 * i] == a || os[2 * i] == b) {
          va++;
          se[2 * i] = os[2 * i];
          if (os[2 * i] == a) {
            se[2 * i + 1] = b;
          } else {
            se[2 * i + 1] = a;
          }
        } else {
          if (os[2 * i + 1] == a || os[2 * i + 1] == b) {
            va++;
            se[2 * i + 1] = os[2 * i + 1];
            if (os[2 * i + 1] == a) {
              se[2 * i] = b;
            } else {
              se[2 * i] = a;
            }
          } else {
            va += 2;
            se[2 * i] = a;
            se[2 * i + 1] = b;
          }
        }
      }
    } else {
      int as = a;
      int bs = b;
      a = c;
      b = d;
      if ((os[2 * i] == a && os[2 * i + 1] == b) ||
          (os[2 * i] == b && os[2 * i + 1] == a)) {
        se[2 * i] = os[2 * i];
        se[2 * i + 1] = os[2 * i + 1];
      } else {
        if (os[2 * i] == a || os[2 * i] == b) {
          va++;
          se[2 * i] = os[2 * i];
          if (os[2 * i] == a) {
            se[2 * i + 1] = b;
          } else {
            se[2 * i + 1] = a;
          }
        } else {
          if (os[2 * i + 1] == a || os[2 * i + 1] == b) {
            va++;
            se[2 * i + 1] = os[2 * i + 1];
            if (os[2 * i + 1] == a) {
              se[2 * i] = b;
            } else {
              se[2 * i] = a;
            }
          } else {
            va += 2;
            se[2 * i] = a;
            se[2 * i + 1] = b;
          }
        }
      }
      a = as;
      b = bs;
    }
  }
  if (va < ans) {
    ans = va;
    for (int i = 0; i < n * m; i++) {
      sol[i] = se[i];
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  ans = n * m + 1;
  char c;
  int a[n + 1][m + 1];
  int b[n + 1][m + 1];
  int kk = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> c;
      if (c == 'A') a[i][j] = 1;
      if (c == 'G') a[i][j] = 2;
      if (c == 'C') a[i][j] = 3;
      if (c == 'T') a[i][j] = 4;
      b[i][j] = a[i][j];
      os[kk] = a[i][j];
      kk++;
    }
  }
  if (n == 2) {
    for (int i = 1; i <= 4; i++) {
      for (int j = i + 1; j <= 4; j++) {
        sz(i, j);
      }
    }
  } else {
    if (m == 2) {
      for (int i = 1; i <= 4; i++) {
        for (int j = i + 1; j <= 4; j++) {
          szb(i, j);
        }
      }
    } else {
      for (int i = 1; i <= 4; i++) {
        for (int j = 1; j <= 4; j++) {
          if (i != j) {
            s(i, j);
            o(i, j);
          }
        }
      }
    }
  }
  kk = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (sol[kk] == 1) cout << 'A';
      if (sol[kk] == 2) cout << 'G';
      if (sol[kk] == 3) cout << 'C';
      if (sol[kk] == 4) cout << 'T';
      kk++;
    }
    cout << endl;
  }
}
