#include <bits/stdc++.h>
const int N = 500 + 10;
int n, m, oo, ans, f[N][26][26];
struct node {
  int a, b;
} pre[N][26][26], t;
char s[N][N];
int cost(int i, int a, int b) {
  int res = 0;
  for (int j = 1; j <= m; j++) res += s[i][j] != ((j & 1 ? a : b) + 97);
  return res;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  memset(f, 40, sizeof f);
  ans = oo = f[0][0][0];
  for (int a = 0; a <= 25; a++)
    for (int b = 0; b <= 25; b++)
      if (a != b) f[1][a][b] = cost(1, a, b);
  for (int i = 2; i <= n; i++)
    for (int a = 0; a <= 25; a++)
      for (int b = 0; b <= 25; b++)
        if (a != b) {
          int c = cost(i, a, b);
          for (int x = 0; x <= 25; x++)
            if (x != a)
              for (int y = 0; y <= 25; y++)
                if (y != b && x != y && f[i - 1][x][y] != oo)
                  if (f[i][a][b] > f[i - 1][x][y] + c)
                    f[i][a][b] = f[i - 1][x][y] + c,
                    pre[i][a][b] = (node){x, y};
        }
  for (int i = 0; i <= 25; i++)
    for (int j = 0; j <= 25; j++)
      if (ans > f[n][i][j]) ans = f[n][i][j], t = (node){i, j};
  printf("%d\n", ans);
  for (int i = n; i >= 1; i--) {
    for (int j = 1; j <= m; j++) s[i][j] = (j & 1 ? t.a : t.b) + 97;
    t = pre[i][t.a][t.b];
  }
  for (int i = 1; i <= n; i++) puts(s[i] + 1);
}
