#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int dp[500][26][26], predj[500][26][26], predk[500][26][26];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<string> vs(n);
  for (auto &s : vs) cin >> s;
  vector<vector<int>> dp1(n, vector<int>(26)), dp2(n, vector<int>(26));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      for (int k = 0; k < 26; k++) {
        int val = vs[i][j] == 'a' + k ? 0 : 1;
        if (j % 2)
          dp2[i][k] += val;
        else
          dp1[i][k] += val;
      }
    }
  }
  int bj = -1, bk = -1;
  for (int j = 0; j < 26; j++) {
    for (int k = 0; k < 26; k++) {
      dp[0][j][k] = j == k ? MOD : dp1[0][j] + dp2[0][k];
      if (bj == -1 || dp[0][j][k] < dp[0][bj][bk]) {
        bj = j;
        bk = k;
      }
    }
  }
  for (int i = 1; i < n; i++) {
    int bjt = -1, bkt = -1;
    for (int j = 0; j < 26; j++) {
      for (int k = 0; k < 26; k++) {
        if (j == k) {
          dp[i][j][k] = MOD;
          continue;
        }
        int base = dp1[i][j] + dp2[i][k];
        if (j != bj && k != bk) {
          dp[i][j][k] = dp[i - 1][bj][bk] + base;
          predj[i][j][k] = bj;
          predk[i][j][k] = bk;
        } else {
          dp[i][j][k] = MOD;
          for (int j2 = 0; j2 < 26; j2++) {
            for (int k2 = 0; k2 < 26; k2++) {
              if (j2 != j && k2 != k &&
                  dp[i - 1][j2][k2] + base < dp[i][j][k]) {
                dp[i][j][k] = dp[i - 1][j2][k2] + base;
                predj[i][j][k] = j2;
                predk[i][j][k] = k2;
              }
            }
          }
        }
        if (bjt == -1 || dp[i][j][k] < dp[i][bjt][bkt]) {
          bjt = j;
          bkt = k;
        }
      }
    }
    bj = bjt;
    bk = bkt;
  }
  cout << dp[n - 1][bj][bk] << '\n';
  vector<string> ans;
  for (int i = n - 1; i >= 0; i--) {
    int bjcur = bj, bkcur = bk;
    string s(m, '.');
    for (int j = 0; j < m; j++) {
      s[j] = j % 2 ? 'a' + bk : 'a' + bj;
    }
    ans.push_back(s);
    bj = predj[i][bjcur][bkcur];
    bk = predk[i][bjcur][bkcur];
  }
  for (auto it = ans.rbegin(); it != ans.rend(); it++) cout << *it << '\n';
  return 0;
}
