#include <bits/stdc++.h>
using namespace std;
long n, m;
char s[600][600];
long f[600][30][30] = {0}, nho1[1000][30][30], nho2[1000][30][30];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i = i + 1) {
    cin >> s[i];
  }
  for (int k = 1; k <= n; k = k + 1) {
    for (int i = 1; i <= 26; i = i + 1)
      for (int j = 1; j <= 26; j = j + 1) {
        long dem = 0, min = 100000000;
        for (int temp = 0; temp < m; temp = temp + 1) {
          if (temp % 2 == 0 && (i + 96) != s[k][temp]) dem = dem + 1;
          if (temp % 2 == 1 && (j + 96) != s[k][temp]) dem = dem + 1;
        }
        if (i == j) dem = 10000000;
        if (k == 1)
          f[k][i][j] = dem;
        else {
          for (int i1 = 1; i1 <= 26; i1 = i1 + 1)
            for (int j1 = 1; j1 <= 26; j1 = j1 + 1) {
              if (f[k - 1][i1][j1] < min && i1 != i && j1 != j) {
                min = f[k - 1][i1][j1];
                nho1[k][i][j] = i1;
                nho2[k][i][j] = j1;
              }
              f[k][i][j] = min + dem;
            }
        }
      }
  }
  long min = 100000000, nho3, nho4;
  for (int i = 1; i <= 26; i = i + 1)
    for (int j = 1; j <= 26; j = j + 1) {
      if (f[n][i][j] < min) {
        min = f[n][i][j];
        nho3 = i, nho4 = j;
      }
    }
  cout << min << endl;
  for (int k = n; k >= 1; k = k - 1) {
    for (int temp = 0; temp < m; temp = temp + 1) {
      if (temp % 2 == 0) s[k][temp] = nho3 + 96;
      if (temp % 2 == 1) s[k][temp] = nho4 + 96;
    }
    long res1 = nho1[k][nho3][nho4], res2 = nho2[k][nho3][nho4];
    nho3 = res1;
    nho4 = res2;
  }
  for (int i = 1; i <= n; i = i + 1) {
    cout << s[i] << endl;
  }
  return 0;
}
