#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const double PI = 3.141592653589793;
const int N = 505;
int n, m, r, i, j, k, l, k1, l1, tab[N][N], res[N][30][30], dp[N][30][30];
char t[N];
vector<pair<int, int> > wek;
pair<int, int> pop[N][30][30], w;
int main() {
  scanf("%d %d", &n, &m);
  for (i = 0; i < n; i++) {
    scanf("%s", &t);
    for (j = 0; j < m; j++) tab[i][j] = int(t[j]) - 'a';
    for (k = 0; k < 26; k++)
      for (l = 0; l < 26; l++) res[i][k][l] = m;
    for (j = 0; j < m; j += 2)
      for (l = 0; l < 26; l++) res[i][tab[i][j]][l]--;
    for (j = 1; j < m; j += 2)
      for (k = 0; k < 26; k++) res[i][k][tab[i][j]]--;
    if (i == 0) {
      for (k = 0; k < 26; k++)
        for (l = 0; l < 26; l++)
          if (k != l) dp[i][k][l] = res[i][k][l];
    } else {
      for (k = 0; k < 26; k++)
        for (l = 0; l < 26; l++) dp[i][k][l] = INF;
      for (k = 0; k < 26; k++)
        for (l = 0; l < 26; l++)
          if (k != l)
            for (k1 = 0; k1 < 26; k1++)
              for (l1 = 0; l1 < 26; l1++)
                if (k1 != l1 && k1 != k && l1 != l &&
                    dp[i][k][l] > dp[i - 1][k1][l1] + res[i][k][l]) {
                  dp[i][k][l] = dp[i - 1][k1][l1] + res[i][k][l];
                  pop[i][k][l] = pair<int, int>(k1, l1);
                }
    }
  }
  r = INF;
  for (k = 0; k < 26; k++)
    for (l = 0; l < 26; l++)
      if (k != l && dp[n - 1][k][l] < r) {
        r = dp[n - 1][k][l];
        k1 = k;
        l1 = l;
      }
  printf("%d\n", r);
  wek.push_back(pair<int, int>(k1, l1));
  while (wek.size() < n) {
    w = pop[n - wek.size()][k1][l1];
    k1 = w.first;
    l1 = w.second;
    wek.push_back(pair<int, int>(k1, l1));
  }
  for (i = n - 1; i >= 0; i--) {
    for (j = 0; j < m; j++)
      if (j % 2 == 0)
        printf("%c", wek[i].first + 97);
      else
        printf("%c", wek[i].second + 97);
    printf("\n");
  }
  return 0;
}
