#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9;
const int mm = 504;
const int nn = 26;
char grap[mm][mm];
int m, n;
int f[mm][nn][nn];
int a_path[mm][nn][nn], b_path[mm][nn][nn];
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 << "\n";
}
int main() {
  while (cin >> m >> n) {
    for (int i = 0; i < m; i++) cin >> grap[i];
    for (int i = 0; i < nn; i++)
      for (int j = 0; j < nn; j++) {
        if (i == j)
          f[0][i][j] = oo;
        else
          f[0][i][j] = cost(0, i, j);
      }
    for (int i = 1; i < m; i++)
      for (int A = 0; A < nn; A++)
        for (int B = 0; B < nn; B++) {
          if (A == B) continue;
          int cur = cost(i, A, B);
          int mid, _min = oo, x = -1, y = -1;
          for (int a = 0; a < nn; a++)
            for (int b = 0; b < nn; 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 = oo, x, y;
    for (int a = 0; a < nn; a++)
      for (int b = 0; b < nn; 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);
  }
}
