#include <bits/stdc++.h>
using namespace std;
int table[505][28][28], n, m, occ[505][26][2], odd, even;
int solve(int idx, int c1, int c2) {
  if (idx == n) {
    return 0;
  }
  int &ret = table[idx][c1][c2];
  if (ret != -1) return ret;
  ret = (int)10e6;
  for (int i = 0; i < 26; ++i) {
    if (c1 != i)
      for (int j = 0; j < 26; ++j) {
        if (i != j && j != c2) {
          ret = min(ret, solve(idx + 1, i, j) + (even - occ[idx][i][0]) +
                             (odd - occ[idx][j][1]));
        }
      }
  }
  return ret;
}
void print(int idx, int c1, int c2) {
  if (idx == n) {
    return;
  }
  int &ret = table[idx][c1][c2];
  for (int i = 0; i < 26; ++i) {
    if (c1 != i)
      for (int j = 0; j < 26; ++j) {
        if (i != j && j != c2) {
          if (ret == solve(idx + 1, i, j) + (even - occ[idx][i][0]) +
                         (odd - occ[idx][j][1])) {
            for (int k = 0; k < m; ++k) {
              if (k % 2 == 0) {
                cout << char(i + 'a');
              } else {
                cout << (char)(j + 'a');
              }
            }
            cout << endl;
            print(idx + 1, i, j);
            return;
          }
        }
      }
  }
}
int main() {
  char tmp;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> tmp;
      ++occ[i][tmp - 'a'][j % 2];
    }
  }
  odd = m / 2;
  even = (m + 1) / 2;
  memset(table, -1, sizeof table);
  int res = solve(0, 26, 26);
  cout << res << endl;
  print(0, 26, 26);
  return 0;
}
