Problem: A colored stripe is represented by a horizontal row of n square cells, each cell is pained one of k colors. Your task is to repaint the minimum number of cells so that no two neighbouring cells are of the same color. You can use any color from 1 to k to repaint the cells.

Input

The first input line contains two integers n and k (1 ≤ n ≤ 5·105; 2 ≤ k ≤ 26). The second line contains n uppercase English letters. Letter "A" stands for the first color, letter "B" stands for the second color and so on. The first k English letters may be used. Each letter represents the color of the corresponding cell of the stripe.

Output

Print a single integer — the required minimum number of repaintings. In the second line print any possible variant of the repainted stripe.

Examples

Input

6 3
ABBACC


Output

2
ABCACA


Input

3 2
BBB


Output

1
BAB

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 6 * 1e5;
const int INF = 1e9 + 7;
int n, k, f[MAXN][50];
string s;
int L[500], R[500];
int i;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k;
  cin >> s;
  s = "+" + s;
  for (i = 1; i <= n; i++) {
    L[0] = INF;
    L[1] = f[i - 1][1];
    for (int j = 2; j <= k; j++) L[j] = min(L[j - 1], f[i - 1][j]);
    R[k + 1] = INF;
    R[k] = f[i - 1][k];
    for (int j = k - 1; j >= 1; j--) R[j] = min(R[j + 1], f[i - 1][j]);
    for (int j = 1; j <= k; j++) {
      int add = 0;
      if (s[i] - 'A' + 1 != j) add = 1;
      f[i][j] = min(L[j - 1], R[j + 1]) + add;
    }
  }
  int ans = INF;
  for (int i = 1; i <= k; i++) ans = min(ans, f[n][i]);
  cout << ans << endl;
  int x;
  for (x = 1; x <= 26; x++)
    if (f[n][x] == ans) break;
  char ch;
  char res[MAXN];
  while (n) {
    ch = 'A' + x - 1;
    res[n] = ch;
    int add = 0;
    if (ch != s[n]) add = 1;
    int y;
    for (y = 1; y <= 26; y++)
      if (y != x && f[n - 1][y] + add == f[n][x]) {
        x = y;
        break;
      }
    n--;
  }
  for (int i = 1; i <= s.length() - 1; i++) cout << res[i];
  return 0;
}