#include <bits/stdc++.h>
using namespace std;
void da(int *a, int s, int e) {
  for (int i = s; i < e; i++) cout << a[i] << " ";
}
void db(string s) { cout << s << '\n'; }
void cp(int *a, int *b, int n) {
  for (int i = 0; i < n; i++) b[i] = a[i];
}
void de(int a) { cout << a << " <\n"; }
const long long N = 1e3 + 10, MOD = 1e9 + 7, INF = 1e15 + 10, LOG = 20, V = 26;
string s[N], t[N];
int n, m, dp[N][V][V];
pair<int, int> par[N][V][V], per;
void get_ans(int x) {
  if (!(~x)) return;
  for (int i = 0; i < m; i++)
    if (i & 1)
      t[x].push_back(per.second + 'a');
    else
      t[x].push_back(per.first + 'a');
  per = par[x][per.first][per.second];
  get_ans(x - 1);
  cout << t[x] << '\n';
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    for (char &j : s[i]) j -= 'a';
  }
  memset(dp, 127, sizeof dp);
  int tmp;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < V; j++)
      for (int k = 0; k < V; k++) {
        if (k == j) continue;
        tmp = 0;
        for (int h = 0; h < m; h++)
          if (h & 1)
            tmp += (k != s[i][h]);
          else
            tmp += (j != s[i][h]);
        for (int q = 0; q < V; q++) {
          if (q == j) continue;
          for (int w = 0; w < V; w++) {
            if (w == k) continue;
            if (dp[i][j][k] > dp[i - 1][q][w] + tmp) {
              dp[i][j][k] = dp[i - 1][q][w] + tmp;
              par[i][j][k] = {q, w};
            }
          }
        }
      }
  int mn = 1e9 + 10;
  for (int i = 0; i < V; i++)
    for (int j = 0; j < V; j++)
      if (mn > dp[n - 1][i][j]) mn = dp[n - 1][i][j], per = {i, j};
  cout << mn << '\n';
  get_ans(n - 1);
}
