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 JAVA):

Solution:
import java.io.*;
import java.util.*;

public class R135_D2_C {
    static int n;
    static int k;
    static String qw;
    static int DP[][];
    static int re[][];

    public static int call(int curr, int prev) {
        if (curr == n)
            return 0;
        if (DP[curr][prev] != -1)
            return DP[curr][prev];
        int res = 1000000000;
        int currchar = (qw.charAt(curr) - 'A' + 1);
        if (prev != currchar) {
            res = call(curr + 1, currchar);
            re[curr][prev] = currchar;
        }

        int nextOne = ((currchar + 1) % (k + 1)) + ((currchar + 1) / (k + 1));
        int nextTwo = ((currchar + 2) % (k + 1)) + ((currchar + 2) / (k + 1));
        if (nextOne != prev) {
            if (1 + call(curr + 1, nextOne) < res) {
                res = 1 + call(curr + 1, nextOne);
                re[curr][prev] = nextOne;
            }
        }
        if (nextTwo != prev) {
            if (1 + call(curr + 1, nextTwo) < res) {
                res = 1 + call(curr + 1, nextTwo);
                re[curr][prev] = nextTwo;
            }
        }
        return DP[curr][prev] = res;
    }

    public static void main(String[] args) throws Exception {
        InputReader in = new InputReader(System.in);
        n = in.readInt();
        k = in.readInt();
        qw = in.readString();
        DP = new int[n + 1][k + 1];
        re = new int[n + 1][k + 1];
        for (int i = 0; i < DP.length; i++) {
            Arrays.fill(DP[i], -1);
            Arrays.fill(re[i], -1);
        }
        int out = call(0, 0);
        System.out.println(out);
        char[] res = new char[n];
        int prev = 0;

        for (int i = 0; i < res.length; i++) {
            res[i] = (char) (re[i][prev] + 'A' - 1);
            prev = re[i][prev];
        }

        System.out.println(new String(res));
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1000];
        private int curChar, numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        private int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long readLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private String readLine0() {
            StringBuffer buf = new StringBuffer();
            int c = read();
            while (c != '\n' && c != -1) {
                buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }

        public String readLine() {
            String s = readLine0();
            while (s.trim().length() == 0)
                s = readLine0();
            return s;
        }

        public String readLine(boolean ignoreEmptyLines) {
            if (ignoreEmptyLines)
                return readLine();
            else
                return readLine0();
        }

        public char readCharacter() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            return (char) c;
        }

        public double readDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, readInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
    }
}