#include <bits/stdc++.h>
const int maxn = 505;
const int inf = 0x3fffffff;
int dp[maxn][26][26], pnt[maxn][26][26][2], add[maxn][26][26], n, m;
char data[maxn][maxn];
void init() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", data[i]);
}
void prepare() {
  for (int h = 0; h < n; h++) {
    for (int i = 0; i < 26; i++) {
      for (int j = 0; j < 26; j++) {
        if (i == j) continue;
        for (int k = 0; k < m; k++) {
          if (k % 2 == 0)
            add[h][i][j] += data[h][k] != 'a' + i;
          else
            add[h][i][j] += data[h][k] != 'a' + j;
        }
      }
    }
  }
}
void work() {
  prepare();
  for (int h = 0; h < n; h++) {
    for (int i = 0; i < 26; i++) {
      for (int j = 0; j < 26; j++) {
        dp[h][i][j] = inf;
        if (i == j) continue;
        int t = add[h][i][j];
        if (h) {
          for (int x = 0; x < 26; x++) {
            if (x == i) continue;
            for (int y = 0; y < 26; y++) {
              if (y == j) continue;
              if (x == y) continue;
              if (dp[h][i][j] > dp[h - 1][x][y] + t) {
                dp[h][i][j] = dp[h - 1][x][y] + t;
                pnt[h][i][j][0] = x;
                pnt[h][i][j][1] = y;
              }
            }
          }
        } else
          dp[h][i][j] = dp[h][i][j] > t ? t : dp[h][i][j];
      }
    }
  }
  int path[maxn][2], t = 0, ans = inf;
  for (int i = 0; i < 26; i++) {
    for (int j = 0; j < 26; j++) {
      if (ans > dp[n - 1][i][j]) {
        ans = dp[n - 1][i][j];
        path[t][0] = i;
        path[t][1] = j;
      }
    }
  }
  while (t < n - 1) {
    int x = path[t][0], y = path[t++][1];
    path[t][0] = pnt[n - t][x][y][0];
    path[t][1] = pnt[n - t][x][y][1];
  }
  printf("%d\n", ans);
  for (int i = n; i > 0; i--) {
    for (int j = 0; j < m; j++)
      printf("%c", j % 2 ? 'a' + path[i - 1][1] : 'a' + path[i - 1][0]);
    printf("\n");
  }
}
int main() {
  init();
  work();
  return 0;
}
