#include <bits/stdc++.h>
using namespace std;
const int maxn = 510;
const int maxc = 26;
char Map[maxn][maxn];
int n, m;
int dp[maxn][maxc][maxc];
int preL[maxn][maxc][maxc];
int preR[maxn][maxc][maxc];
int res[maxn][2];
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) scanf("%s", Map[i]);
  memset(dp, 0x3f, sizeof dp);
  for (int i = 0; i < 26; i++) {
    for (int j = 0; j < 26; j++) {
      if (i == j) continue;
      dp[0][i][j] = 0;
      for (int t = 0; t < m; t++) {
        if (t & 1) {
          if (Map[0][t] - 'a' != j) dp[0][i][j]++;
        } else {
          if (Map[0][t] - 'a' != i) dp[0][i][j]++;
        }
      }
    }
  }
  for (int l = 1; l < n; l++) {
    for (int i = 0; i < 26; i++) {
      for (int j = 0; j < 26; j++) {
        if (i == j) continue;
        int cnt = 0;
        for (int t = 0; t < m; t++) {
          if (t & 1) {
            if (Map[l][t] - 'a' != j) cnt++;
          } else {
            if (Map[l][t] - 'a' != i) cnt++;
          }
        }
        for (int A = 0; A < 26; A++) {
          if (A == i) continue;
          for (int B = 0; B < 26; B++) {
            if (A == B || B == j) continue;
            if (dp[l][i][j] > dp[l - 1][A][B] + cnt) {
              dp[l][i][j] = dp[l - 1][A][B] + cnt;
              preL[l][i][j] = A;
              preR[l][i][j] = B;
            }
          }
        }
      }
    }
  }
  int ans = 0x3f3f3f3f;
  int nowl, nowr;
  for (int i = 0; i < 26; i++) {
    for (int j = 0; j < 26; j++) {
      if (i == j) continue;
      if (ans > dp[n - 1][i][j]) {
        ans = dp[n - 1][i][j];
        nowl = i;
        nowr = j;
      }
    }
  }
  cout << ans << endl;
  res[n - 1][0] = nowl, res[n - 1][1] = nowr;
  for (int i = n - 1; i >= 1; i--) {
    int ll = preL[i][nowl][nowr];
    int rr = preR[i][nowl][nowr];
    res[i - 1][0] = ll, res[i - 1][1] = rr;
    nowl = ll, nowr = rr;
  }
  for (int i = 0; i < n; i++) {
    char x = res[i][0] + 'a';
    char y = res[i][1] + 'a';
    for (int j = 0; j < m; j++) {
      if (j & 1)
        cout << y;
      else
        cout << x;
    }
    cout << endl;
  }
  return 0;
}
