#include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)(1e9 + 7);
long long modpow(long long a, long long b) {
  if (!b) return 1;
  a %= mod;
  return modpow(a * a % mod, b / 2) * (b & 1 ? a : 1) % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  int dp[n][26][26];
  pair<int, int> back[n][26][26];
  string start;
  cin >> start;
  memset(dp, mod, sizeof(dp));
  for (int a = 0; a < 26; a++)
    for (int b = 0; b < 26; b++)
      if (a != b) {
        dp[0][a][b] = 0;
        for (int j = 0; j < m; j++)
          dp[0][a][b] += start[j] - 'a' != (j & 1 ? b : a);
      }
  for (int i = 0; i < n - 1; i++) {
    string s;
    cin >> s;
    for (int a = 0; a < 26; a++)
      for (int b = 0; b < 26; b++)
        if (a != b) {
          dp[i + 1][a][b] = 0;
          for (int j = 0; j < m; j++)
            dp[i + 1][a][b] += s[j] - 'a' != (j & 1 ? b : a);
          pair<int, int> mini(-1, -1);
          for (int a_p = 0; a_p < 26; a_p++)
            if (a_p != a)
              for (int b_p = 0; b_p < 26; b_p++)
                if (b_p != b && a_p != b_p)
                  if (mini.first == -1 ||
                      dp[i][a_p][b_p] < dp[i][mini.first][mini.second])
                    mini = pair<int, int>(a_p, b_p);
          dp[i + 1][a][b] += dp[i][mini.first][mini.second];
          back[i + 1][a][b] = mini;
        }
  }
  pair<int, int> ans(-1, -1);
  for (int a = 0; a < 26; a++)
    for (int b = 0; b < 26; b++)
      if (a != b && (ans.first == -1 ||
                     dp[n - 1][a][b] < dp[n - 1][ans.first][ans.second]))
        ans = pair<int, int>(a, b);
  cout << dp[n - 1][ans.first][ans.second] << endl;
  vector<string> ansstack;
  int x = n;
  while (--x + 1) {
    string s;
    for (int j = 0; j < m; j++)
      s += char((j & 1 ? ans.second : ans.first) + 'a');
    ansstack.push_back(s);
    ans = back[x][ans.first][ans.second];
  }
  while (!ansstack.empty()) {
    cout << ansstack.back() << endl;
    ansstack.pop_back();
  }
  return 0;
}
