#include <bits/stdc++.h>
using namespace std;
int n, m, a[501][501], dp[501][26][26];
pair<int, int> par[501][26][26];
char ss[501][502];
void trace(int i, int p, int q) {
  if (!i) return;
  trace(i - 1, par[i][p][q].first, par[i][p][q].second);
  for (int j = 1; j <= m; j++) {
    if (j % 2)
      printf("%c", 'a' + p);
    else
      printf("%c", 'a' + q);
  }
  printf("\n");
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", ss[i] + 1);
    for (int j = 1; j <= m; j++) a[i][j] = ss[i][j] - 'a';
    for (int p = 0; p < 26; p++) {
      for (int q = 0; q < 26; q++) {
        if (p == q) {
          dp[i][p][q] = INT_MAX;
          continue;
        }
        for (int j = 1; j <= m; j++) {
          if (j % 2)
            dp[i][p][q] += (a[i][j] != p);
          else
            dp[i][p][q] += (a[i][j] != q);
        }
        int mn = 1e9;
        for (int r = 0; r < 26; r++)
          for (int s = 0; s < 26; s++)
            if (r != s and r != p and s != q and
                dp[i - 1][r][s] <=
                    dp[i - 1][par[i][p][q].first][par[i][p][q].second])
              mn = dp[i - 1][r][s], par[i][p][q] = {r, s};
        dp[i][p][q] += mn;
      }
    }
  }
  int p = 0, q = 0;
  for (int x = 0; x < 26; x++)
    for (int y = 0; y < 26; y++)
      if (dp[n][x][y] < dp[n][p][q]) p = x, q = y;
  printf("%d\n", dp[n][p][q]);
  trace(n, p, q);
}
