#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000");
template <class T>
inline T& RD(T& x) {
  char c;
  while (!isdigit((c = getchar())))
    ;
  x = c - '0';
  while (isdigit((c = getchar()))) x = x * 10 + c - '0';
  return x;
}
template <class T>
inline T& RDD(T& x) {
  char c;
  while ((c = getchar()), c != '-' && !isdigit(c))
    ;
  if (c == '-') {
    x = '0' - (c = getchar());
    while (isdigit((c = getchar()))) x = x * 10 + '0' - c;
  } else {
    x = c - '0';
    while (isdigit((c = getchar()))) x = x * 10 + c - '0';
  }
  return x;
}
inline double& RF(double& x) {
  char c;
  while ((c = getchar()), c != '-' && c != '.' && !isdigit(c))
    ;
  if (c == '-')
    if ((c = getchar()) == '.') {
      x = 0;
      double l = 1;
      while (isdigit((c = getchar()))) l /= 10, x = x * 10 + '0' - c;
      x *= l;
    } else {
      x = '0' - c;
      while (isdigit((c = getchar()))) x = x * 10 + '0' - c;
      if (c == '.') {
        double l = 1;
        while (isdigit((c = getchar()))) l /= 10, x = x * 10 + '0' - c;
        x *= l;
      }
    }
  else if (c == '.') {
    x = 0;
    double l = 1;
    while (isdigit((c = getchar()))) l /= 10, x = x * 10 + c - '0';
    x *= l;
  } else {
    x = c - '0';
    while (isdigit((c = getchar()))) x = x * 10 + c - '0';
    if (c == '.') {
      double l = 1;
      while (isdigit((c = getchar()))) l /= 10, x = x * 10 + c - '0';
      x *= l;
    }
  }
  return x;
}
using namespace std;
char Map[510][510];
int ans[2][26];
int val[510][26][26];
int pre[510][26][26][2];
void dfs(int n, int m, int px, int py) {
  if (n == 1) {
    for (int i = 1; i <= m; ++i)
      if (i & 1)
        printf("%c", (char)(px + 'a'));
      else
        printf("%c", (char)(py + 'a'));
    puts("");
    return;
  }
  dfs(n - 1, m, pre[n][px][py][0], pre[n][px][py][1]);
  for (int i = 1; i <= m; ++i)
    if (i & 1)
      printf("%c", (char)(px + 'a'));
    else
      printf("%c", (char)(py + 'a'));
  puts("");
}
int main() {
  int n, m, i, j, k, l, p;
  scanf("%d %d", &n, &m);
  for (i = 1; i <= n; ++i) scanf("%s", Map[i] + 1);
  for (i = 1; i <= n; ++i) {
    memset(ans, 0, sizeof(ans));
    for (j = 1; j <= m; ++j) ans[j & 1][Map[i][j] - 'a']++;
    for (j = 0; j < 26; ++j)
      for (k = 0; k < 26; ++k) val[i][j][k] = m - ans[1][j] - ans[0][k];
  }
  int Min;
  for (i = 2; i <= n; ++i) {
    for (j = 0; j < 26; ++j)
      for (k = 0; k < 26; ++k) {
        Min = 0x3f3f3f3f;
        for (l = 0; l < 26; ++l) {
          if (j == l) continue;
          for (p = 0; p < 26; ++p) {
            if (k == p || l == p) continue;
            if (val[i - 1][l][p] < Min)
              Min = val[i - 1][l][p], pre[i][j][k][0] = l, pre[i][j][k][1] = p;
          }
        }
        val[i][j][k] += Min;
      }
  }
  Min = 0x3f3f3f3f;
  int px, py;
  for (i = 0; i < 26; ++i)
    for (j = 0; j < 26; ++j)
      if (i != j && val[n][i][j] < Min) Min = val[n][i][j], px = i, py = j;
  printf("%d\n", Min);
  dfs(n, m, px, py);
  return 0;
}
