#include <bits/stdc++.h>
using namespace std;
long long n, m;
string s[502];
long long dp[505][27][27];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (long long i = 0; i < n; i++) cin >> s[i];
  for (long long i = 0; i < n; i++) {
    for (char a = 'a'; a <= 'z'; a++) {
      for (char b = 'a'; b <= 'z'; b++) {
        if (a == b) continue;
        long long cnt = 0;
        for (long long j = 0; j < m; j++) {
          if (j % 2 && s[i][j] != b)
            cnt++;
          else if (j % 2 == 0 && s[i][j] != a)
            cnt++;
        }
        dp[i][a - 'a'][b - 'a'] = cnt;
        if (i == 0) continue;
        long long tmp = 1e10;
        for (char x = 'a'; x <= 'z'; x++) {
          if (x == a) continue;
          for (char y = 'a'; y <= 'z'; y++) {
            if (y == b || x == y) continue;
            tmp = min(tmp, dp[i - 1][x - 'a'][y - 'a']);
          }
        }
        dp[i][a - 'a'][b - 'a'] += tmp;
      }
    }
  }
  long long ans = 1e10;
  vector<pair<char, char> > p(n);
  for (long long i = n - 1; i >= 0; i--) {
    long long val = 1e10;
    for (char a = 'a'; a <= 'z'; a++) {
      for (char b = 'a'; b <= 'z'; b++) {
        if (a == b) continue;
        if (i < n - 1) {
          if (a == p[i + 1].first || b == p[i + 1].second) continue;
        }
        if (dp[i][a - 'a'][b - 'a'] < val) {
          val = dp[i][a - 'a'][b - 'a'];
          p[i].first = a;
          p[i].second = b;
        }
      }
    }
    if (i == n - 1) ans = val;
  }
  cout << ans << endl;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (j % 2)
        cout << p[i].second;
      else
        cout << p[i].first;
    }
    cout << endl;
  }
  return 0;
}
