#include <bits/stdc++.h>
using namespace std;
const int N = 500;
char a[N][N + 1];
int w[N][26][26], dp[N][26][26], pre[N][26][26], cnt[26][2];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  memset(w, 0x77, sizeof(w));
  for (int i = 0; i < n; i++) {
    scanf("%s", a[i]);
    memset(cnt, 0, sizeof(cnt));
    for (int j = 0; j < m; j++)
      if (j % 2 == 0)
        cnt[a[i][j] - 'a'][0]++;
      else
        cnt[a[i][j] - 'a'][1]++;
    for (int j = 0; j < 26; j++)
      for (int k = 0; k < 26; k++)
        if (j != k) w[i][j][k] = m - cnt[j][0] - cnt[k][1];
  }
  memset(dp, 0x77, sizeof(dp));
  for (int j = 0; j < 26; j++)
    for (int k = 0; k < 26; k++) dp[0][j][k] = w[0][j][k];
  for (int i = 1; i < n; i++)
    for (int j = 0; j < 26; j++)
      for (int k = 0; k < 26; k++)
        if (j != k)
          for (int l = 0; l < 26; l++)
            if (l != j)
              for (int p = 0; p < 26; p++)
                if (p != l && p != k &&
                    dp[i - 1][l][p] + w[i][j][k] < dp[i][j][k]) {
                  dp[i][j][k] = dp[i - 1][l][p] + w[i][j][k];
                  pre[i][j][k] = l * 26 + p;
                }
  int ans = INT_MAX, ansx = -1;
  for (int j = 0; j < 26; j++)
    for (int k = 0; k < 26; k++)
      if (dp[n - 1][j][k] < ans) {
        ans = dp[n - 1][j][k];
        ansx = j * 26 + k;
      }
  printf("%d\n", ans);
  for (int i = n; --i >= 0;) {
    int c1 = ansx / 26, c2 = ansx % 26;
    for (int j = 0; j < m; j++) a[i][j] = j % 2 == 0 ? c1 + 'a' : c2 + 'a';
    ansx = pre[i][c1][c2];
  }
  for (int i = 0; i < n; i++) printf("%s\n", a[i]);
}
