#include <bits/stdc++.h>
using namespace std;
const int N = 510, inf = 1e9;
int dp[N][27][27], n, m, ans, sc[N][27][27];
pair<int, int> mark[N][27][27];
char grid[N][N], tmp[N][N];
int score(int i, int j, int k) {
  int cnt = 0;
  for (int ind = 0; ind < m; ind++) {
    if (ind & 1)
      if (grid[i][ind] - 'a' != k) cnt++;
    if (!(ind & 1))
      if (grid[i][ind] - 'a' != j) cnt++;
  }
  return cnt;
}
void Solve() {
  ans = inf;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 26; j++)
      for (int k = 0; k < 26; k++) dp[i][j][k] = inf;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 26; j++)
      for (int k = 0; k < 26; k++) sc[i][j][k] = score(i, j, k);
  for (int i = 0; i < 26; i++)
    for (int j = 0; j < 26; j++) {
      if (i == j && m != 1) continue;
      dp[0][i][j] = sc[0][i][j];
    }
  for (int i = 1; i < n; i++)
    for (int j = 0; j < 26; j++)
      for (int k = 0; k < 26; k++) {
        if (m != 1 && k == j) continue;
        for (int u = 0; u < 26; u++)
          for (int v = 0; v < 26; v++)
            if (u != j && v != k && u != v)
              if (dp[i][j][k] > dp[i - 1][u][v] + sc[i][j][k]) {
                dp[i][j][k] = dp[i - 1][u][v] + sc[i][j][k];
                mark[i][j][k] = make_pair(u, v);
              }
      }
  pair<int, int> temp;
  for (int i = 0; i < 26; i++) {
    for (int j = 0; j < 26; j++) {
      if (ans > dp[n - 1][i][j]) temp = make_pair(i, j), ans = dp[n - 1][i][j];
    }
  }
  cout << ans << "\n";
  for (int i = n - 1; i >= 0; i--) {
    for (int ind = 0; ind < m; ind++) {
      if (ind & 1) tmp[i][ind] = char(('a' + temp.second));
      if (!(ind & 1)) tmp[i][ind] = char('a' + temp.first);
    }
    temp = mark[i][temp.first][temp.second];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cout << tmp[i][j];
    cout << "\n";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> grid[i][j];
  Solve();
  return 0;
}
