#include <bits/stdc++.h>
using namespace std;
long long int powmod(long long int a, int b, int n) {
  long long int rm = 1;
  while (b) {
    if (b % 2) {
      rm = (rm * a) % n;
    }
    a = (a * a) % n;
    b /= 2;
  }
  return rm;
}
int dp[510][27][27], o[30], e[30], n, m, tr[510][27][27][2];
string grid[510];
void go(int ind, int ti, int tj) {
  if (!ind) return;
  go(ind - 1, tr[ind][ti][tj][0], tr[ind][ti][tj][1]);
  for (int i = 1; i <= m; ++i) {
    if (i % 2)
      printf("%c", 'a' + ti - 1);
    else
      printf("%c", 'a' + tj - 1);
  }
  printf("\n");
}
int main() {
  cin >> n >> m;
  for (int i = int(1); i <= (int)n; i++) cin >> grid[i];
  memset(dp[0], 0, sizeof(dp[0]));
  ;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= 26; ++j) {
      for (int k = 1; k <= 26; ++k) dp[i][j][k] = 1e9;
    }
    memset(o, 0, sizeof(o));
    ;
    memset(e, 0, sizeof(e));
    ;
    for (int j = 1; j <= m; j += 2) o[grid[i][j - 1] - 'a' + 1]++;
    for (int j = 2; j <= m; j += 2) e[grid[i][j - 1] - 'a' + 1]++;
    for (int j = 1; j <= 26; ++j) {
      for (int k = 1; k <= 26; ++k) {
        if (j != k) {
          int cost = m - o[j] - e[k];
          for (int j1 = 1; j1 <= 26; ++j1) {
            if (j == j1) continue;
            for (int k1 = 1; k1 <= 26; ++k1) {
              if (j1 != k1 && k != k1) {
                if (cost + dp[i - 1][j1][k1] < dp[i][j][k]) {
                  dp[i][j][k] = cost + dp[i - 1][j1][k1];
                  tr[i][j][k][0] = j1;
                  tr[i][j][k][1] = k1;
                }
              }
            }
          }
        }
      }
    }
  }
  int ans = 1e9, gi, gj;
  for (int i = 1; i <= 26; ++i) {
    for (int j = 1; j <= 26; ++j) {
      if (i != j) {
        if (ans > dp[n][i][j]) {
          gi = i;
          gj = j;
          ans = dp[n][i][j];
        }
      }
    }
  }
  cout << ans << endl;
  go(n, gi, gj);
  return 0;
}
