#include <bits/stdc++.h>
using namespace std;
char grap[505][505];
int m, n;
int f[505][26][26];
int a_path[505][26][26], b_path[505][26][26];
int cost(int x, int a, int b) {
  a += 'a';
  b += 'a';
  int ret = 0;
  for (int i = 0; i < n; i++)
    if (i & 1)
      ret += (a != grap[x][i]);
    else
      ret += (b != grap[x][i]);
  return ret;
}
void print(int z, int x, int y) {
  if (z) print(z - 1, a_path[z][x][y], b_path[z][x][y]);
  for (int i = 0; i < n; i++)
    if (i & 1)
      cout << char(x + 'a');
    else
      cout << char(y + 'a');
  cout << endl;
}
int main() {
  cin >> m >> n;
  for (int i = 0; i < m; i++) cin >> grap[i];
  for (int i = 0; i < 26; i++)
    for (int j = 0; j < 26; j++) {
      if (i == j)
        f[0][i][j] = 1e9;
      else
        f[0][i][j] = cost(0, i, j);
    }
  for (int i = 1; i < m; i++)
    for (int A = 0; A < 26; A++)
      for (int B = 0; B < 26; B++) {
        if (A == B) continue;
        int cur = cost(i, A, B);
        int mid, _min = 1e9, x = -1, y = -1;
        for (int a = 0; a < 26; a++)
          for (int b = 0; b < 26; b++) {
            if (a == A || b == B || a == b) continue;
            if (_min > f[i - 1][a][b]) {
              _min = f[i - 1][a][b];
              x = a;
              y = b;
            }
          }
        f[i][A][B] = _min + cur;
        a_path[i][A][B] = x;
        b_path[i][A][B] = y;
      }
  int _min = 1e9, x, y;
  for (int a = 0; a < 26; a++)
    for (int b = 0; b < 26; b++) {
      if (a == b) continue;
      if (_min > f[m - 1][a][b]) {
        _min = f[m - 1][a][b];
        x = a;
        y = b;
      }
    }
  cout << f[m - 1][x][y] << "\n";
  print(m - 1, x, y);
  return 0;
}
