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;
bool visited[9][9];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  string s2;
  cin >> s2;
  string s;
  s = s2;
  if (k == 2) {
    if (n == 1) {
      cout << "0"
           << "\n";
      cout << s2;
      return 0;
    }
    string s3[2];
    s3[0] = "AB";
    s3[1] = "BA";
    for (int i = 0; i <= 1; i++) {
      for (int j = 2; j < n; j++) {
        s3[i] += s3[i][j - 2];
      }
    }
    long long steps = 0;
    long long ans = INT_MAX;
    string s4;
    for (int j = 0; j <= 1; j++) {
      string s1 = s3[j];
      steps = 0;
      for (int i = 0; i < n; i++) {
        if (s1[i] != s2[i]) ++steps;
      }
      if (steps < ans) {
        s4 = s1;
        ans = steps;
      }
    }
    cout << ans << "\n";
    cout << s4;
    return 0;
  }
  for (int i = 0; i < s.size(); i++) {
    int cnt = 1;
    int prev = i + 1;
    while (s[i] == s[i + 1]) {
      ++i;
      ++cnt;
    }
    char ch;
    if (cnt % 2 == 0) {
      int j;
      for (j = 65; j <= 64 + k; j++) {
        char ch1 = char(j);
        if (ch1 != s[i + 1] && ch1 != s[i]) {
          ch = ch1;
          break;
        }
      }
      if (j == 65 + k) {
        for (int m = 65; m <= 64 + k; m++) {
          char ch1 = char(m);
          if (i == 0) {
            if (ch1 != s[i]) {
              ch = ch1;
              break;
            }
          } else {
            if (ch1 != s[i] && ch1 != s[i - 1]) {
              ch = ch1;
              break;
            }
          }
        }
        for (int j = prev - 1; j <= (i - 1); j += 2) s[j] = ch;
      } else {
        for (int j = prev; j <= i; j += 2) s[j] = ch;
      }
    } else if (cnt != 1) {
      for (int j = 65; j <= 64 + k; j++) {
        char ch1 = char(j);
        if (ch1 != s[i]) {
          ch = ch1;
          break;
        }
      }
      for (int j = prev; j <= i; j += 2) s[j] = ch;
    }
  }
  long long cnt = 0;
  for (int j = 0; j < s2.size(); j++) {
    if (s[j] != s2[j]) ++cnt;
  }
  cout << cnt << "\n";
  cout << s;
  return 0;
}