#include <bits/stdc++.h>
using namespace std;
const int INF = 999999999;
int n, m;
char s[600];
int dp[501][26][26];
pair<int, int> fr[501][26][26];
pair<int, pair<int, int> > mm[501][26][26][2][2];
void output(int i, int j, int k) {
  if (!i) return;
  output(i - 1, fr[i][j][k].first, fr[i][j][k].second);
  for (int i = 0; i < m; i++) putchar((i % 2 ? k : j) + 'a');
  puts("");
}
int main() {
  scanf("%d%d", &n, &m);
  gets(s);
  memset(dp, 63, sizeof(dp));
  memset(mm, 63, sizeof(mm));
  for (int j = 0; j < 26; j++)
    for (int k = 0; k < 26; k++)
      if (j != k) dp[0][j][k] = 0;
  for (int i = 0; i <= n; i++) {
    if (i) {
      gets(s);
      for (int j = 0; j < 26; j++)
        for (int k = 0; k < 26; k++)
          if (j != k) {
            int cnt = 0;
            for (int t = 0; t < m; t++)
              if (s[t] - 'a' != (t % 2 ? k : j)) cnt++;
            pair<int, pair<int, int> > tmp(INF, {});
            for (int x = 0; x < 2; x++)
              for (int y = 0; y < 2; y++) tmp = min(tmp, mm[i - 1][j][k][x][y]);
            dp[i][j][k] = tmp.first + cnt;
            fr[i][j][k] = tmp.second;
          }
    }
    for (int x = 0; x < 2; x++)
      for (int y = 0; y < 2; y++) {
        int u = x ? -1 : 1, v = y ? -1 : 1;
        for (int j = x ? 24 : 1; j != (x ? -1 : 26); j += u)
          for (int k = y ? 24 : 1; k != (y ? -1 : 26); k += v) {
            mm[i][j][k][x][y] = {dp[i][j - u][k - v], {j - u, k - v}};
            mm[i][j][k][x][y] = min(mm[i][j][k][x][y], mm[i][j - u][k][x][y]);
            mm[i][j][k][x][y] = min(mm[i][j][k][x][y], mm[i][j][k - v][x][y]);
          }
      }
  }
  int x = 0, y = 0, ans = INF;
  for (int j = 0; j < 26; j++)
    for (int k = 0; k < 26; k++)
      if (dp[n][j][k] < ans) ans = dp[n][x = j][y = k];
  printf("%d\n", dp[n][x][y]);
  output(n, x, y);
}
