#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 507;
string s[N];
const int A = 26;
int dp[N][A][A];
int na[N][A][A], nb[N][A][A];
int row, col;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> row >> col;
  for (int i = 0; i < row; ++i) cin >> s[i];
  memset(dp, inf, sizeof dp);
  for (int i = 0; i < A; ++i)
    for (int j = 0; j < A; ++j) dp[row][i][j] = 0;
  for (int r = row - 1; r >= 0; --r) {
    for (int a = 0; a < A; ++a) {
      for (int b = 0; b < A; ++b) {
        if (a == b) continue;
        int cost = 0;
        for (int c = 0; c < col; ++c) {
          if (c & 1)
            cost += (s[r][c] - 'a' != b);
          else
            cost += (s[r][c] - 'a' != a);
        }
        for (int pa = 0; pa < A; ++pa) {
          if (pa == a) continue;
          for (int pb = 0; pb < A; ++pb) {
            if (pb == b) continue;
            if (dp[r + 1][pa][pb] < dp[r][a][b]) {
              dp[r][a][b] = dp[r + 1][pa][pb];
              na[r][a][b] = pa;
              nb[r][a][b] = pb;
            }
          }
        }
        if (dp[r][a][b] < inf) dp[r][a][b] += cost;
      }
    }
  }
  int best = inf, ca, cb;
  for (int a = 0; a < A; ++a) {
    for (int b = 0; b < A; ++b) {
      if (a != b and best > dp[0][a][b]) {
        ca = a, cb = b;
        best = dp[0][a][b];
      }
    }
  }
  cout << best << "\n";
  int r = 0;
  while (r < row) {
    for (int j = 0; j < col; ++j) cout << (char)((j & 1) ? 'a' + cb : 'a' + ca);
    cout << "\n";
    int ta = na[r][ca][cb];
    int tb = nb[r][ca][cb];
    ca = ta, cb = tb;
    ++r;
  }
  return 0;
}
