#include <bits/stdc++.h>
using namespace std;
const int maxn = 510;
long long cnt[maxn][26][2], n, m, ans[maxn][26][26];
pair<int, int> pre[maxn][26][26];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < m; j++) {
      char c;
      cin >> c;
      cnt[i][c - 'a'][j % 2]++;
    }
  }
  for (int i = 0; i < 26; i++) {
    for (int j = 0; j < 26; j++) {
      ans[1][i][j] = INT_MAX;
      if (i == j) {
        continue;
      }
      ans[1][i][j] = ((m + 1) / 2) - cnt[1][i][0] + (m / 2) - cnt[1][j][1];
      pre[1][i][j] = {i, j};
    }
  }
  for (int ii = 2; ii <= n; ii++) {
    for (int i = 0; i < 26; i++) {
      for (int j = 0; j < 26; j++) {
        ans[ii][i][j] = INT_MAX;
        if (i == j) continue;
        for (int _i = 0; _i < 26; _i++) {
          for (int _j = 0; _j < 26; _j++) {
            if (_i == i || _j == j || _i == _j) continue;
            if (ans[ii][i][j] >
                ans[ii - 1][_i][_j] +
                    (((m + 1) / 2) - cnt[ii][i][0] + (m / 2) - cnt[ii][j][1])) {
              ans[ii][i][j] =
                  ans[ii - 1][_i][_j] +
                  (((m + 1) / 2) - cnt[ii][i][0] + (m / 2) - cnt[ii][j][1]);
              pre[ii][i][j] = {_i, _j};
            }
          }
        }
      }
    }
  }
  pair<int, int> last;
  int minn = INT_MAX;
  for (int i = 0; i < 26; i++) {
    for (int j = 0; j < 26; j++) {
      if (minn > ans[n][i][j]) {
        minn = ans[n][i][j];
        last = {i, j};
      }
    }
  }
  cout << minn << endl;
  stack<pair<int, int>> res;
  for (int i = n; i >= 1; i--) {
    res.push(last);
    last = pre[i][last.first][last.second];
  }
  while (!res.empty()) {
    for (int i = 0; i < m; i++) {
      if (i % 2)
        cout << char(res.top().second + 'a');
      else
        cout << char(res.top().first + 'a');
    }
    cout << endl;
    res.pop();
  }
  return 0;
}
