#include <bits/stdc++.h>
using namespace std;
const int N = 555;
const int ALPHA = 26;
int n, m;
int f[N][ALPHA][ALPHA];
pair<int, int> trace[N][ALPHA][ALPHA];
char s[N][N];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", s[i] + 1);
  }
  memset(f, 40, sizeof(f));
  int ans = f[0][0][0], inf = f[0][0][0];
  auto calc = [&](int i, int a, int b) {
    int res = 0;
    for (int j = 1; j <= m; ++j) {
      res += (s[i][j] != (j & 1 ? a + 'a' : b + 'a'));
    }
    return res;
  };
  for (int a = 0; a < ALPHA; ++a) {
    for (int b = 0; b < ALPHA; ++b) {
      if (a != b) {
        f[1][a][b] = calc(1, a, b);
      }
    }
  }
  for (int i = 2; i <= n; ++i) {
    for (int a = 0; a < ALPHA; ++a) {
      for (int b = 0; b < ALPHA; ++b) {
        if (a != b) {
          int c = calc(i, a, b);
          for (int x = 0; x < ALPHA; ++x) {
            if (x != a) {
              for (int y = 0; y < ALPHA; ++y) {
                if (y != b && x != y && f[i - 1][x][y] != inf) {
                  if (f[i][a][b] > f[i - 1][x][y] + c) {
                    f[i][a][b] = f[i - 1][x][y] + c;
                    trace[i][a][b] = {x, y};
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  pair<int, int> t;
  for (int i = 0; i < ALPHA; ++i) {
    for (int j = 0; j < ALPHA; ++j) {
      if (ans > f[n][i][j]) {
        ans = f[n][i][j];
        t = {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.first + 'a' : t.second + 'a';
    }
    t = trace[i][t.first][t.second];
  }
  for (int i = 1; i <= n; ++i) {
    puts(s[i] + 1);
  }
  return 0;
}
