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;
int n, k;
string s;
int main() {
  cin >> n >> k;
  cin >> s;
  for (int i = 0; i < n; i++) {
    s[i] -= 'A';
  }
  if (k == 2) {
    bool b = 0;
    int c1 = 0, c2 = 0;
    string s1 = "", s2 = "";
    for (int i = 0; i < n; i++) {
      if (b) {
        s1 += (char)0;
        s2 += (char)1;
      } else {
        s2 += (char)0;
        s1 += (char)1;
      }
      c1 += s[i] != s1[i];
      c2 += s[i] != s2[i];
      b = !b;
    }
    string out = s1;
    if (c1 > c2) out = s2;
    for (int i = 0; i < n; i++) {
      out[i] += 'A';
    }
    cout << min(c1, c2) << endl << out;
    return 0;
  }
  int last = -1;
  vector<int> sts;
  for (int i = 0; i < n; i++) {
    if (s[i] != last) {
      sts.push_back(i);
      last = s[i];
    }
  }
  sts.push_back(n);
  int cost = 0;
  for (int i = 0; i < sts.size() - 1; i++) {
    int sz = sts[i + 1] - sts[i];
    if (sz == 1) continue;
    if (sz == 2) {
      last = -1;
      if (i != 0) {
        last = s[sts[i] - 1];
      }
      cost++;
      for (int j = 0; j < k; j++) {
        if (j == last || j == s[sts[i]]) continue;
        s[sts[i]] = j;
        break;
      }
    } else if (sz % 2 == 0) {
      last = -1;
      if (i != 0) {
        last = s[sts[i] - 1];
      }
      int r1;
      r1 = 0;
      if (s[sts[i]] == 0) r1 = 1;
      if (last == r1) r1++;
      if (s[sts[i]] == r1) r1++;
      bool b = 0;
      for (int j = sts[i]; j < sts[i + 1] - 1; j += 2) {
        s[j] = r1;
        cost++;
        b = !b;
      }
    } else if (sz % 2 == 1) {
      int r1 = 0;
      if (s[sts[i]] == 0) r1 = 1;
      for (int j = sts[i] + 1; j < sts[i + 1] - 1; j += 2) {
        s[j] = r1;
        cost++;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    s[i] += 'A';
  }
  cout << cost << endl << s;
  return 0;
}