#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
const long long inf = 2147383647;
const double pi = 2 * acos(0.0);
const double eps = 1e-9;
const long long maxint = 2147483647;
const long long minint = -2147483648;
using namespace std;
int row, col;
char grid[510][510];
int color(int r, int a, int b) {
  int i, res = 0;
  for (i = 0; i < col; i += 2) {
    if (grid[r][i] != a) res++;
  }
  for (i = 1; i < col; i += 2) {
    if (grid[r][i] != b) res++;
  }
  return res;
}
long long memo[510][26][26];
struct next {
  int a, b;
} nx[510][26][26];
long long dp(int level, int a, int b) {
  if (level < 0) {
    return 0;
  }
  if (memo[level][a][b] != -1) return memo[level][a][b];
  int cost = color(level, a, b);
  long long res = inf, temp;
  int i, j;
  for (i = 0; i < 26; i++) {
    for (j = 0; j < 26; j++) {
      if (i == j || i == a || j == b) continue;
      temp = cost + dp(level - 1, i, j);
      if (temp < res) {
        res = temp;
        nx[level][a][b].a = i;
        nx[level][a][b].b = j;
      }
    }
  }
  memo[level][a][b] = res;
  return res;
}
void print(int level, int a, int b) {
  if (level < 0) return;
  print(level - 1, nx[level][a][b].a, nx[level][a][b].b);
  int i;
  for (i = 0; i < col; i++) {
    if (i % 2 == 0)
      printf("%c", a + 'a');
    else
      printf("%c", b + 'a');
  }
  puts("");
}
int main() {
  memset(memo, -1, sizeof memo);
  scanf("%d %d", &row, &col);
  int i, j;
  for (i = 0; i < row; i++) {
    scanf("%s", &grid[i][0]);
    for (j = 0; j < col; j++) grid[i][j] -= 'a';
  }
  long long res = inf, temp, pi, pj;
  for (i = 0; i < 26; i++) {
    for (j = 0; j < 26; j++) {
      if (i == j) continue;
      temp = dp(row - 1, i, j);
      if (temp < res) {
        res = temp;
        pi = i;
        pj = j;
      }
    }
  }
  printf("%lld\n", res);
  print(row - 1, pi, pj);
  return 0;
}
