#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double eps = 1e-9;
const double pi = acos(-1.0);
int cost[500][2][26];
pair<int, int> p[500][26][26];
int main() {
  int n, m;
  cin >> n >> m;
  vector<string> s(n);
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 26; k++) {
        int cur = 0;
        for (int t = j; t < m; t += 2) cur += int(s[i][t] != char(k + 'a'));
        cost[i][j][k] = cur;
      }
  vector<pair<int, pair<int, int> > > v, u;
  for (int i = 0; i < 26; i++)
    for (int j = 0; j < 26; j++) {
      if (i == j) continue;
      v.push_back(make_pair(cost[0][0][i] + cost[0][1][j], make_pair(i, j)));
    }
  sort((v).begin(), (v).end());
  for (int i = 1; i < n; i++) {
    u.clear();
    for (int a = 0; a < 26; a++)
      for (int b = 0; b < 26; b++) {
        if (a == b) continue;
        for (int c = 0; c < (int)(v).size(); c++)
          if (v[c].second.first != a && v[c].second.second != b) {
            u.push_back(make_pair(cost[i][0][a] + cost[i][1][b] + v[c].first,
                                  make_pair(a, b)));
            p[i][a][b] = v[c].second;
            break;
          }
      }
    v = u;
    sort((v).begin(), (v).end());
  }
  cout << v[0].first << endl;
  int a = v[0].second.first;
  int b = v[0].second.second;
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < m; j++)
      if (j % 2 == 0)
        s[i][j] = char(a + 'a');
      else
        s[i][j] = char(b + 'a');
    int aa = p[i][a][b].first;
    int bb = p[i][a][b].second;
    a = aa;
    b = bb;
  }
  for (int i = 0; i < n; i++) cout << s[i] << endl;
  return 0;
}
