#include <bits/stdc++.h>
using namespace std;
const int maxn = 500 + 10;
const int maxh = 26 + 10;
int t[maxn][maxh][maxh];
int dp[maxn][maxh][maxh];
pair<long long, long long> par[maxn][maxh][maxh];
int n, m;
char c[maxn][maxn];
int o[maxn][maxh], e[maxn][maxh];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) cin >> c[i][j];
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      if (j % 2 == 1)
        o[i][c[i][j] - 'a' + 1]++;
      else
        e[i][c[i][j] - 'a' + 1]++;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= 26; ++j)
      for (int l = 1; l <= 26; ++l)
        if (l != j) t[i][j][l] = m - o[i][j] - e[i][l];
  for (int i = 1; i <= 26; ++i)
    for (int j = 1; j <= 26; ++j)
      if (i != j) dp[1][i][j] = t[1][i][j];
  for (int i = 2; i <= n; ++i) {
    for (int j = 1; j <= 26; ++j)
      for (int l = 1; l <= 26; ++l) dp[i][j][l] = 1000000000;
    for (int j = 1; j <= 26; ++j)
      for (int l = 1; l <= 26; ++l)
        for (int k = 1; k <= 26; ++k)
          for (int q = 1; q <= 26; ++q)
            if (j != l && k != q && k != j && q != l)
              if (dp[i][j][l] > dp[i - 1][k][q] + t[i][j][l]) {
                dp[i][j][l] = dp[i - 1][k][q] + t[i][j][l];
                par[i][j][l] = pair<long long, long long>(k, q);
              }
  }
  int X = 1, Y = 2;
  for (int i = 1; i <= 26; ++i)
    for (int j = 1; j <= 26; ++j)
      if (i != j && dp[n][i][j] < dp[n][X][Y]) X = i, Y = j;
  vector<string> ans;
  int now = n;
  cout << dp[n][X][Y] << endl;
  for (; X != 0 && Y != 0;) {
    string ret = "";
    for (int i = 1; i <= m; ++i)
      if (i % 2 == 1)
        ret += char(X + 'a' - 1);
      else
        ret += char(Y + 'a' - 1);
    int cpx = X, cpy = Y;
    X = par[now][cpx][cpy].first;
    Y = par[now][cpx][cpy].second;
    now--;
    ans.push_back(ret);
  }
  for (int i = ans.size() - 1; i >= 0; --i) cout << ans[i] << endl;
  return 0;
}
