#include <bits/stdc++.h>
using namespace std;
const int N = 502;
int dp[N][26][26];
int cost[N][26][26];
void solve() {
  memset(dp, 0, sizeof(dp));
  int n, m;
  cin >> n >> m;
  char arr[n + 1][m + 1];
  for (int i = 1; i < n + 1; ++i) {
    for (int j = 1; j < m + 1; ++j) {
      cin >> arr[i][j];
    }
  }
  for (int r = 1; r < n + 1; ++r) {
    for (int i = 0; i < 26; ++i)
      for (int j = 0; j < 26; ++j) {
        dp[r][i][j] = INT_MAX;
      }
  }
  for (int r = 1; r < n + 1; ++r) {
    for (int i = 0; i < 26; ++i)
      for (int j = 0; j < 26; ++j) {
        int cnt = 0;
        if (i == j) {
          continue;
        }
        for (int c = 1; c < m + 1; ++c) {
          if (c & 1) {
            if (arr[r][c] - 'a' != i) {
              cnt++;
            }
          } else {
            if (arr[r][c] - 'a' != j) {
              cnt++;
            }
          }
        }
        cost[r][i][j] = cnt;
      }
  }
  for (int r = 1; r < n + 1; ++r) {
    for (int i = 0; i < 26; ++i)
      for (int j = 0; j < 26; ++j)
        for (int p = 0; p < 26; ++p)
          for (int q = 0; q < 26; ++q) {
            if (i == p or j == q or i == j or p == q) {
              continue;
            }
            dp[r][i][j] = min(dp[r][i][j], dp[r - 1][p][q] + cost[r][i][j]);
          }
  }
  int cur = dp[n][0][1];
  for (int i = 0; i < 26; ++i)
    for (int j = 0; j < 26; ++j) {
      if (i == j) {
        continue;
      }
      cur = min(cur, dp[n][i][j]);
    }
  cout << cur << endl;
  char ans[n + 1][m + 1];
  int a = -1, b = -1;
  for (int r = n; r >= 1; r--) {
    for (int i = 0; i < 26; ++i)
      for (int j = 0; j < 26; ++j) {
        if (i == j or i == a or j == b) {
          continue;
        }
        if (dp[r][i][j] == cur) {
          a = i;
          b = j;
          i = 26;
          j = 26;
        }
      }
    cur -= cost[r][a][b];
    for (int c = 1; c < m + 1; ++c) {
      if (c & 1) {
        ans[r][c] = 'a' + a;
      } else {
        ans[r][c] = 'a' + b;
      }
    }
  }
  for (int i = 1; i < n + 1; ++i)
    for (int j = 1; j < m + 1; ++j) {
      cout << ans[i][j];
      if (j == m) cout << endl;
    }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int T = 1;
  while (T--) {
    solve();
  }
}
