#include <bits/stdc++.h>
using namespace std;
const int oo = (int)1e9;
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
int dcmp(double a, double b) {
  return (fabs(a - b) <= eps) ? 0 : ((a < b) ? -1 : 1);
}
char str[500][500];
int arr[500][500];
int n, m;
int predist[500][26][26];
int frq[500][26][2];
int dist(int idx, int ch1, int ch2) {
  int ch[] = {ch1, ch2};
  int ans = 0;
  for (int i = 0; i < m; i++) ans += arr[idx][i] != ch[i % 2];
  return ans;
}
void init() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 26; j++) {
      for (int k = 0; k < 26; k++) {
        predist[i][j][k] = dist(i, j, k);
      }
    }
  }
}
int mem[500][27][27];
int calc(int idx, int A, int B) {
  if (idx == n) return 0;
  int& r = mem[idx][A][B];
  if (r != -1) return r;
  r = oo;
  for (int i = 0; i < 26; i++) {
    for (int j = 0; j < 26; j++) {
      if (i == j || i == A || j == B) continue;
      r = min(r, calc(idx + 1, i, j) + m - frq[idx][i][0] - frq[idx][j][1]);
    }
  }
  return r;
}
void build(int idx, int A, int B) {
  if (idx == n) return;
  int r = calc(idx, A, B);
  for (int i = 0; i < 26; i++) {
    for (int j = 0; j < 26; j++) {
      if (i == j || i == A || j == B) continue;
      int r1 = calc(idx + 1, i, j) + m - frq[idx][i][0] - frq[idx][j][1];
      if (r1 == r) {
        int ch[] = {i, j};
        for (int k = 0; k < m; k++) printf("%c", char(ch[k % 2] + 'a'));
        printf("\n");
        build(idx + 1, i, j);
        return;
      }
    }
  }
  return;
}
int main() {
  cin >> n >> m;
  if (scanf("%d%d", &n, &m) == EOF) return 0;
  memset(frq, 0, sizeof frq);
  for (int i = 0; i < n; i++) {
    scanf("%s", str[i]);
    for (int j = 0; j < m; j++) frq[i][str[i][j] - 'a'][j % 2]++;
  }
  memset(mem, -1, sizeof mem);
  printf("%d\n", calc(0, 26, 26));
  build(0, 26, 26);
  return 0;
}
