#include <bits/stdc++.h>
#pragma comment(linker, "/STACK=100000000")
using namespace std;
const int INF = (1 << 20);
int n, m;
string A[501];
int DP[501][26][26];
int C[501][26][26];
int P1[501][26][26];
int P2[501][26][26];
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int i = 0; i < n + 1; 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++) {
        C[i][j][k] = 0;
        for (int l = 0; l < m; l++) {
          if (l % 2 == 0 && A[i][l] - 'a' != j) C[i][j][k]++;
          if (l % 2 == 1 && A[i][l] - 'a' != k) C[i][j][k]++;
        }
      }
  for (int i = 0; i < 26; i++)
    for (int j = 0; j < 26; j++) DP[0][i][j] = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 26; j++)
      for (int k = 0; k < 26; k++)
        if (DP[i][j][k] < INF) {
          for (int l = 0; l < 26; l++)
            for (int h = 0; h < 26; h++)
              if (l != h && l != j && h != k) {
                if (DP[i][j][k] + C[i][l][h] < DP[i + 1][l][h]) {
                  DP[i + 1][l][h] = DP[i][j][k] + C[i][l][h];
                  P1[i + 1][l][h] = j;
                  P2[i + 1][l][h] = k;
                }
              }
        }
  vector<pair<int, int> > R;
  int x = n, y = 0, z = 0, r = INF;
  for (int i = 0; i < 26; i++)
    for (int j = 0; j < 26; j++)
      if (DP[n][i][j] < r) {
        r = DP[n][i][j];
        y = i;
        z = j;
      }
  cout << r << endl;
  for (int i = 0; i < n; i++) {
    R.push_back(make_pair(y, z));
    int ty = P1[x][y][z], tz = P2[x][y][z];
    y = ty;
    z = tz;
    x--;
  }
  reverse(R.begin(), R.end());
  for (int i = 0; i < n; i++) {
    string s = "";
    for (int j = 0; j < m; j++) {
      if (j % 2 == 0)
        s += char('a' + R[i].first);
      else
        s += char('a' + R[i].second);
    }
    cout << s << endl;
  }
  cin >> n;
}
