#include <bits/stdc++.h>
using namespace std;
int n, m, a[500][500], rec[500][2][26], dp[500][26][26], tp[500][26][26][2], c1,
    c2, ans;
void show() {
  int flag[500][2];
  for (int i = n - 1; i >= 0; i--) {
    flag[i][0] = c1;
    flag[i][1] = c2;
    c1 = tp[i][c1][c2][0];
    c2 = tp[i][flag[i][0]][c2][1];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cout << (char)(flag[i][j % 2] + 'a');
    cout << endl;
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      char tmp;
      cin >> tmp;
      a[i][j] = tmp - 'a';
    }
  for (int i = 0; i < n; i++)
    for (int c = 0; c < 26; c++)
      for (int j = 0; j < m; j++)
        if (a[i][j] != c) rec[i][j % 2][c]++;
  for (int a = 0; a < 26; a++)
    for (int b = 0; b < 26; b++) dp[0][a][b] = rec[0][0][a] + rec[0][1][b];
  for (int i = 1; i < n; i++)
    for (int a = 0; a < 26; a++)
      for (int b = 0; b < 26; b++) {
        dp[i][a][b] = 2e9;
        for (int c = 0; c < 26; c++)
          for (int d = 0; d < 26; d++) {
            if (c == d || a == c || b == d) continue;
            if (dp[i][a][b] > dp[i - 1][c][d]) {
              dp[i][a][b] = dp[i - 1][c][d];
              tp[i][a][b][0] = c;
              tp[i][a][b][1] = d;
            }
          }
        dp[i][a][b] += rec[i][0][a] + rec[i][1][b];
      }
  ans = 2e9;
  for (int a = 0; a < 26; a++)
    for (int b = 0; b < 26; b++) {
      if (a == b) continue;
      if (ans > dp[n - 1][a][b]) {
        ans = dp[n - 1][a][b];
        c1 = a;
        c2 = b;
      }
    }
  cout << ans << endl;
  show();
}
