#include <bits/stdc++.h>
using namespace std;
char mat[500][500];
int dp[500][1000];
int aa[500][1000];
int n, m;
int main() {
  int i, j, k, jj, kk, h;
  while (scanf("%d%d", &n, &m) != -1) {
    for (i = 0; i < n; i++)
      for (j = 0; j < m; j++) {
        scanf(" %c", &mat[i][j]);
        mat[i][j] -= 'a';
      }
    int res = 0x7fffffff, index;
    for (i = 0; i < n; i++) {
      for (j = 0; j < 26; j++)
        for (k = 0; k < 26; k++) {
          if (j == k) continue;
          int xx = j * 26 + k;
          int ans = 0;
          for (h = 0; h < m; h++) {
            if (h % 2 == 0) {
              if (mat[i][h] != j) ans++;
            } else {
              if (mat[i][h] != k) ans++;
            }
          }
          dp[i][xx] = ans;
          if (i > 0) {
            int minn = 0x7fffffff;
            for (jj = 0; jj < 26; jj++) {
              if (jj == j) continue;
              for (kk = 0; kk < 26; kk++) {
                if (kk == jj || kk == k) continue;
                int yy = jj * 26 + kk;
                if (dp[i - 1][yy] < minn) {
                  minn = dp[i - 1][yy];
                  aa[i][xx] = yy;
                }
              }
            }
            dp[i][xx] += minn;
          }
          if (i == n - 1) {
            if (dp[i][xx] < res) {
              res = dp[i][xx];
              index = xx;
            }
          }
        }
    }
    printf("%d\n", res);
    int xx = index;
    for (i = n - 1; i >= 0; i--) {
      int a = xx / 26, b = xx % 26;
      for (j = 0; j < m; j++)
        if (j % 2)
          mat[i][j] = b + 'a';
        else
          mat[i][j] = a + 'a';
      xx = aa[i][xx];
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) printf("%c", mat[i][j]);
      puts("");
    }
  }
  return 0;
}
