#include <bits/stdc++.h>
using namespace std;
const int MAXINT = 1000000000;
int n, m;
int dp[500][26][26];
int rec[500][26][26][2];
char a[500][500];
int cmp(int k, char c1, char c2) {
  int r = 0;
  int i;
  for (i = 0; i < m; i++) {
    if (i & 1) {
      if (a[k][i] != c2) r++;
    } else {
      if (a[k][i] != c1) r++;
    }
  }
  return r;
}
void printline(char c1, char c2) {
  int i;
  for (i = 0; i < m; i++) {
    if (i & 1) {
      printf("%c", c2);
    } else {
      printf("%c", c1);
    }
  }
  printf("\n");
}
void output(int p, int q, int k) {
  if (k == 0) {
    printline(p + 'a', q + 'a');
  } else {
    output(rec[k][p][q][0], rec[k][p][q][1], k - 1);
    printline(p + 'a', q + 'a');
  }
}
void printdp(int k) {
  int i, j;
  for (i = 0; i < 26; i++) {
    for (j = 0; j < 26; j++) {
      printf("%d ", dp[k][i][j]);
    }
    printf("\n");
  }
}
int main() {
  scanf("%d%d", &n, &m);
  getchar();
  int i, j, k, p, q;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      scanf("%c", &a[i][j]);
    }
    getchar();
  }
  for (i = 0; i < 26; i++) {
    for (j = 0; j < 26; j++) {
      if (i == j) {
        dp[0][i][j] = MAXINT;
        continue;
      } else {
        dp[0][i][j] = cmp(0, i + 'a', j + 'a');
      }
    }
  }
  for (k = 1; k < n; k++) {
    int mm = MAXINT;
    int recp, recq;
    for (p = 0; p < 26; p++) {
      for (q = 0; q < 26; q++) {
        if (p == q) continue;
        if (dp[k - 1][p][q] < mm) {
          mm = dp[k - 1][p][q];
          recp = p;
          recq = q;
        }
      }
    }
    for (i = 0; i < 26; i++) {
      for (j = 0; j < 26; j++) {
        if (i == j) {
          dp[k][i][j] = MAXINT;
          continue;
        }
        int d = cmp(k, i + 'a', j + 'a');
        if (i != recp && j != recq) {
          dp[k][i][j] = d + mm;
          rec[k][i][j][0] = recp;
          rec[k][i][j][1] = recq;
          continue;
        }
        int m = 1000000000;
        for (p = 0; p < 26; p++) {
          for (q = 0; q < 26; q++) {
            if (p == i || q == j || p == q) continue;
            if (dp[k - 1][p][q] < m) {
              m = dp[k - 1][p][q];
              rec[k][i][j][0] = p;
              rec[k][i][j][1] = q;
            }
          }
        }
        dp[k][i][j] = d + m;
      }
    }
  }
  int m = 1000000000;
  int mp, mq;
  for (i = 0; i < 26; i++) {
    for (j = 0; j < 26; j++) {
      if (i == j) continue;
      if (dp[n - 1][i][j] < m) {
        m = dp[n - 1][i][j];
        mp = i;
        mq = j;
      }
    }
  }
  printf("%d\n", m);
  output(mp, mq, n - 1);
  return 0;
}
