#include <bits/stdc++.h>
using namespace std;
const long long N = 500 + 7;
const int inf = 1e9 + 7;
int n, m;
char gg[N][N], ans[N][N];
int ggnum[N][N];
int dp[N][N + 200], pre[N][N + 200];
int addM[700];
void init() {
  for (int i = 0; i <= 500; i++) {
    for (int j = 0; j < 676; j++) {
      dp[i][j] = pre[i][j] = inf;
      if (i == 0) dp[i][j] = 0;
    }
  }
}
int main() {
  init();
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", gg[i] + 1);
    for (int j = 1; j <= m; j++) ggnum[i][j] = gg[i][j] - 'a';
  }
  for (int i = 1; i <= n; i++) {
    for (int k1 = 0; k1 < 676; k1++) {
      if (k1 % 26 == k1 / 26) continue;
      addM[k1] = 0;
      int x = k1 % 26, y = k1 / 26;
      for (int j = 1; j <= m; j++)
        if (ggnum[i][j] != (j % 2 == 1 ? x : y)) addM[k1]++;
    }
    for (int k1 = 0; k1 < 676; k1++) {
      for (int k2 = 0; k2 < 676; k2++) {
        int x = k2 % 26, y = k2 / 26;
        if (x == y) continue;
        if (k1 % 26 == x || (k1 / 26 == y)) continue;
        int add = addM[k2];
        if (dp[i][k2] > dp[i - 1][k1] + add) {
          dp[i][k2] = dp[i - 1][k1] + add;
          pre[i][k2] = k1;
        }
      }
    }
  }
  int id = -1;
  for (int i = 0; i < 676; i++) {
    if (dp[n][i] != inf && (id == -1 || dp[n][i] < dp[n][id])) id = i;
  }
  printf("%d\n", dp[n][id]);
  for (int i = n; i >= 1; i--) {
    int x = id % 26, y = id / 26;
    for (int j = 1; j <= m; j++) ans[i][j] = (j % 2 == 1 ? 'a' + x : 'a' + y);
    ans[i][m + 1] = '\0';
    id = pre[i][id];
  }
  for (int i = 1; i <= n; i++) printf("%s\n", ans[i] + 1);
  return 0;
}
