#include <bits/stdc++.h>
using namespace std;
char s[505][505];
int dp[505][30][30], pre[505][30][30][2];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s[i]);
  }
  for (int row = 1; row <= n; row++)
    for (int ii = 0; ii < 26; ii++)
      for (int jj = 0; jj < 26; jj++) {
        dp[row][ii][jj] = 1 << 23;
        if (ii == jj) continue;
        int sum = 0;
        for (int k = 0; k < m; k++) {
          if (k % 2 != 0 && (jj + 'a') != s[row][k])
            sum++;
          else if (k % 2 == 0 && s[row][k] != (ii + 'a'))
            sum++;
        }
        if (row == 1) {
          dp[row][ii][jj] = sum;
          continue;
        }
        for (int i = 0; i < 26; i++) {
          if (ii == i) continue;
          for (int j = 0; j < 26; j++) {
            if (jj == j) continue;
            if (dp[row - 1][i][j] + sum < dp[row][ii][jj]) {
              dp[row][ii][jj] = dp[row - 1][i][j] + sum;
              pre[row][ii][jj][0] = i;
              pre[row][ii][jj][1] = j;
            }
          }
        }
      }
  int x, y, Min = 1 << 23;
  for (int i = 0; i < 26; i++)
    for (int j = 0; j < 26; j++) {
      if (dp[n][i][j] < Min) {
        Min = dp[n][i][j];
        x = i;
        y = j;
      }
    }
  printf("%d\n", Min);
  for (int i = n; i > 0; i--) {
    for (int k = 0; k < m; k++)
      if (k % 2 == 0)
        s[i][k] = x + 'a';
      else
        s[i][k] = y + 'a';
    int xx, yy;
    xx = pre[i][x][y][0];
    yy = pre[i][x][y][1];
    x = xx;
    y = yy;
  }
  for (int row = 1; row <= n; row++) {
    for (int k = 0; k < m; k++) printf("%c", s[row][k]);
    puts("");
  }
}
