#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
template <typename T>
istream &operator>>(istream &in, vector<T> &a) {
  for (auto &x : a) {
    in >> x;
  }
  return in;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &a) {
  for (auto &x : a) {
    os << x << " ";
  }
  os << "\n";
  return os;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<vector<char>> data(n, vector<char>(m));
  cin >> data;
  vector<vector<vector<int>>> dp(n + 1,
                                 vector<vector<int>>(26, vector<int>(26, INF)));
  vector<vector<vector<pair<int, int>>>> pr(
      n + 1,
      vector<vector<pair<int, int>>>(26, vector<pair<int, int>>(26, {-1, -1})));
  for (int i = 0; i < 26; ++i) {
    for (int j = 0; j < 26; ++j) {
      dp[0][i][j] = 0;
    }
  }
  vector<vector<vector<int>>> change(
      n, vector<vector<int>>(26, vector<int>(26, INF)));
  for (int i = 0; i < n; ++i) {
    for (int a = 0; a < 26; ++a) {
      for (int b = 0; b < 26; ++b) {
        if (a == b) {
          continue;
        }
        int cnt = 0;
        for (int j = 0; j < m; ++j) {
          auto c = char(a + 'a');
          if (j % 2) {
            c = char(b + 'a');
          }
          if (data[i][j] != c) {
            ++cnt;
          }
        }
        change[i][a][b] = cnt;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int a = 0; a < 26; ++a) {
      for (int b = 0; b < 26; ++b) {
        if (a == b) {
          continue;
        }
        for (int c = 0; c < 26; ++c) {
          if (c == a) {
            continue;
          }
          for (int d = 0; d < 26; ++d) {
            if (d == b || c == d) {
              continue;
            }
            if (dp[i][c][d] > dp[i - 1][a][b] + change[i - 1][c][d]) {
              dp[i][c][d] = dp[i - 1][a][b] + change[i - 1][c][d];
              pr[i][c][d] = {a, b};
            }
          }
        }
      }
    }
  }
  pair<int, int> now;
  int ans = INF;
  for (int a = 0; a < 26; ++a) {
    for (int b = 0; b < 26; ++b) {
      if (dp[n][a][b] < ans) {
        ans = dp[n][a][b];
        now = {a, b};
      }
    }
  }
  cout << ans << '\n';
  vector<string> res;
  int npos = n;
  while (npos != 0) {
    string q;
    for (int i = 0; i < m; ++i) {
      if (i % 2 == 0) {
        q.push_back(char(now.first + 'a'));
      } else {
        q.push_back(char(now.second + 'a'));
      }
    }
    res.push_back(q);
    now = pr[npos][now.first][now.second];
    npos--;
  }
  for (int i = n - 1; i >= 0; --i) {
    cout << res[i] << "\n";
  }
}
