#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, i, j, k, ans, c, INF = 1E9, a, b, aa, bb;
  cin >> n >> m;
  vector<string> s(n);
  for (i = 0; i < n; i++) cin >> s[i];
  vector<vector<vector<int>>> dp(n,
                                 vector<vector<int>>(26, vector<int>(26, INF)));
  vector<vector<vector<pair<int, int>>>> last(
      n,
      vector<vector<pair<int, int>>>(26, vector<pair<int, int>>(26, {-1, -1})));
  for (i = 0; i < n; i++) {
    for (j = 0; j < 26; j++) {
      for (k = 0; k < 26; k++) {
        if (j == k) continue;
        c = 0;
        for (a = 0; a < m; a++) {
          if ((a % 2 == 0) && (s[i][a] != 'a' + j)) c++;
          if ((a % 2 == 1) && (s[i][a] != 'a' + k)) c++;
        }
        if (i == 0)
          dp[0][j][k] = c;
        else {
          for (a = 0; a < 26; a++) {
            for (b = 0; b < 26; b++) {
              if ((a != j) && (b != k) && (a != b) &&
                  (dp[i][j][k] > dp[i - 1][a][b] + c)) {
                dp[i][j][k] = dp[i - 1][a][b] + c;
                last[i][j][k] = {a, b};
              }
            }
          }
        }
      }
    }
  }
  ans = INF;
  for (i = 0; i < 26; i++) {
    for (j = 0; j < 26; j++) {
      if (dp[n - 1][i][j] < ans) {
        ans = dp[n - 1][i][j];
        a = i;
        b = j;
      }
    }
  }
  cout << ans << "\n";
  vector<pair<int, int>> plist(n);
  for (i = n - 1; i >= 0; i--) {
    plist[i] = {a, b};
    tie(a, b) = last[i][a][b];
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (j % 2 == 0) cout << (char)('a' + plist[i].first);
      if (j % 2 == 1) cout << (char)('a' + plist[i].second);
    }
    cout << "\n";
  }
  return 0;
}
