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.util.*;
import java.io.*;

public class ColorStripe {
    public static InputReader in;
    public static PrintWriter out;

    public static final int MOD = (int) (1e9 + 7);

    public static void main(String[] args) {
	in = new InputReader(System.in);
	out = new PrintWriter(System.out);
	
	int n = in.nextInt(),
		k = in.nextInt();
	int[][] dp = new int[n][k];
	int[][] par = new int[n][k];
	char[] s = in.readString().toCharArray();
	
	Arrays.fill(dp[0], 1);
	Arrays.fill(par[0], -1);
	dp[0][(int)s[0] - (int)'A'] = 0;
	
	int minVal1 = (int)1e6,
		minVal2 = (int)1e6;
	int minChar1 = -1,
		minChar2 = -1;
	
	for (int j = 0; j < k; j++) {
		if(dp[0][j] < minVal1) {
		    minVal1 = dp[0][j];
		    minChar1 = j;
		}
	    }
	    for (int j = 0; j < k; j++) {
		if(minChar1 == j) {
		    continue;
		}
		if(dp[0][j] < minVal2) {
		    minVal2 = dp[0][j];
		    minChar2 = j;
		}
	    }
	
	
	for (int i = 1; i < n; i++) {
	    for (int j = 0; j < k; j++) {
		
		int minValue = (int)1e6;
		int prev = -1;
		if(minChar1 != j) {
		    prev = minChar1;
		    minValue = minVal1;
		}
		if(minChar2 != j && minValue > minVal2) {
		    prev = minChar2;
		    minValue = minVal2;
		}
		
		if(j == (int)s[i] - (int)'A') {
		    dp[i][j] = minValue;
		    par[i][j] = prev;
		} else {
		    dp[i][j] = minValue + 1;
		    par[i][j] = prev;
		}
	    }
	    
	    minVal1 = (int)1e6;
	    minVal2 = (int)1e6;
	    minChar1 = -1;
	    minChar2 = -1;
	    for (int j = 0; j < k; j++) {
		if(dp[i][j] < minVal1) {
		    minVal1 = dp[i][j];
		    minChar1 = j;
		}
	    }
	    for (int j = 0; j < k; j++) {
		if(minChar1 == j) {
		    continue;
		}
		if(dp[i][j] < minVal2) {
		    minVal2 = dp[i][j];
		    minChar2 = j;
		}
	    }
	}
	
	int result = (int)1e6;
	for (int i = 0; i < k; i++) {
	    result = Math.min(result, dp[n - 1][i]);
	}
	out.println(result);
	StringBuilder str = new StringBuilder();
	
	int curr = 0;
	for (int i = 0; i < k; i++) {
	    if(dp[n - 1][i] == result) {
		curr = i;
		break;
	    }
	}
	int idx = n - 1;
	while(curr != -1) {
	    str.append((char)(curr + (int)'A'));
	    curr = par[idx][curr];
	    idx--;
	}
	
	out.println(str.reverse().toString());
	out.close();
    }

    static class Node implements Comparable<Node> {
	int next;
	int dist;

	public Node(int u, int v) {
	    this.next = u;
	    this.dist = v;
	}

	public void print() {
	    out.println(next + " " + dist + " ");
	}

	public int compareTo(Node that) {
	    return Integer.compare(this.next, that.next);
	}
    }

    static class InputReader {

	private InputStream stream;
	private byte[] buf = new byte[8192];
	private int curChar, snumChars;
	private SpaceCharFilter filter;

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

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

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

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

	public int[] nextIntArray(int n) {
	    int a[] = new int[n];
	    for (int i = 0; i < n; i++)
		a[i] = nextInt();
	    return a;
	}

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

	public boolean isSpaceChar(int c) {
	    if (filter != null)
		return filter.isSpaceChar(c);
	    return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public interface SpaceCharFilter {
	    public boolean isSpaceChar(int ch);
	}
    }
}