#include <bits/stdc++.h>
using namespace std;
const int N = 550, A = 26, INF = -1u / 8;
int dp[N][A][A];
int n, m;
string a[N];
pair<int, int> p[N][A][A];
void print(int r, pair<int, int> ind) {
  if (r == 0) return;
  pair<int, int> next = p[r][ind.first][ind.second];
  print(r - 1, next);
  string out;
  for (int i = 0; i < m; i++)
    out += (i % 2 == 0 ? ind.first + 'a' : ind.second + 'a');
  cout << out << "\n";
}
inline bool smin(int &a, int b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    for (int j = 0; j < m; j++) a[i][j] -= 'a';
  }
  memset(dp, 63, sizeof dp);
  for (int i = 0; i < A; i++)
    for (int j = 0; j < A; j++)
      if (i != j) dp[0][i][j] = 0;
  for (int r = 0; r < n; r++)
    for (int i = 0; i < A; i++)
      for (int j = 0; j < A; j++)
        if (i != j) {
          for (int k = 0; k < A; k++)
            if (k != i)
              for (int l = 0; l < A; l++)
                if (k != l && l != j)
                  if (smin(dp[r + 1][i][j], dp[r][k][l]))
                    p[r + 1][i][j] = pair<int, int>(k, l);
          for (int c = 0; c < m; c++)
            if (c % 2 && a[r][c] != j || (c % 2 == 0) && a[r][c] != i)
              dp[r + 1][i][j]++;
        }
  pair<int, int> ind;
  int ans = INF;
  for (int i = 0; i < A; i++)
    for (int j = 0; j < A; j++)
      if (i != j && smin(ans, dp[n][i][j])) ind = pair<int, int>(i, j);
  cout << ans << "\n";
  print(n, ind);
}
