#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[505][505];
int dp[505][30][30];
pair<int, int> par[505][30][30];
vector<pair<int, int> > order;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      char c;
      cin >> c;
      a[i][j] = c - 'a';
    }
  for (int i = 0; i <= 25; i++) {
    for (int j = 0; j <= 25; j++) {
      if (i == j) continue;
      for (int k = 1; k <= m; k += 2)
        if (a[1][k] != i) dp[1][i][j]++;
      for (int k = 2; k <= m; k += 2)
        if (a[1][k] != j) dp[1][i][j]++;
    }
  }
  for (int p = 2; p <= n; p++) {
    for (int i = 0; i <= 25; i++) {
      for (int j = 0; j <= 25; j++) {
        if (i == j) continue;
        int &cur = dp[p][i][j];
        for (int k = 1; k <= m; k += 2)
          if (a[p][k] != i) cur++;
        for (int k = 2; k <= m; k += 2)
          if (a[p][k] != j) cur++;
        pair<int, pair<int, int> > mn = make_pair(2e9, make_pair(0, 0));
        for (int xi = 0; xi <= 25; xi++) {
          for (int xj = 0; xj <= 25; xj++) {
            if (xi == xj || xi == i || xj == j) continue;
            mn = min(mn, make_pair(dp[p - 1][xi][xj], make_pair(xi, xj)));
          }
        }
        cur += mn.first;
        par[p][i][j] = mn.second;
      }
    }
  }
  pair<int, pair<int, int> > ans = make_pair(2e9, make_pair(0, 0));
  for (int i = 0; i <= 25; i++)
    for (int j = 0; j <= 25; j++)
      if (i != j) ans = min(ans, make_pair(dp[n][i][j], make_pair(i, j)));
  cout << ans.first << '\n';
  pair<int, int> t = ans.second;
  order.push_back(t);
  int cur = n;
  while (cur >= 2) {
    t = par[cur][t.first][t.second];
    cur--;
    order.push_back(t);
  }
  reverse(order.begin(), order.end());
  for (int i = 0; i < order.size(); i++) {
    for (int j = 1; j <= m; j++) {
      if (j & 1)
        cout << char(order[i].first + 'a');
      else
        cout << char(order[i].second + 'a');
    }
    cout << '\n';
  }
}
