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

public class C {

	public static void main(String[] args) {
		FastReader in = new FastReader();
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt(), k = in.nextInt();
		char[] arr = in.next().toCharArray();
		int ans = 0;
		if(k==2) {
			char[] newStringAB = generateAB(n);
			char[] newStringBA = generateBA(n);
			int ab = compare(arr,newStringAB);
			int ba = compare(arr,newStringBA);
			if(ab>ba) {
				ab = ba;
				newStringAB = newStringBA;
			}
			out.println(ab);
			for(char x:newStringAB) out.print(x);
			out.close();
			return;
		}
		for(int i=0;i<n-1;i++) {
			if(arr[i]==arr[i+1]) {
				int j = i;
				int cnt = 0;
				while(j+1<n && arr[j]==arr[j+1]) {
					j++;
					cnt++;
				}
				if(cnt%2==0) {
					char replace = arr[i]=='A'?'B':'A';
					for(int l = i+1;l<j;l+=2) {
						arr[l] = replace;
						ans++;
					}
					
				}
				else {
					char temp1 = i-1>=0?arr[i-1]:arr[i];
					char temp2 = arr[i];
					char replace = 'A';
					while(temp1==replace||temp2==replace) 
						replace = (char)(replace+1);
//					System.out.println(replace);
					for(int l=i;l<j;l+=2) {
//						System.out.println("here");
						arr[l] = replace;
						ans++;
					}
				}
				i = j;
			}
		}
		out.println(ans);
		for(char x:arr) out.print(x);
		out.close();
	}
	public static int compare(char[] a,char[] b) {
		int ans =0;
		for(int i=0;i<a.length;i++) {
			if(a[i]!=b[i]) ans++;
		}
		return ans;
	}
	public static char[] generateAB(int n) {
		char[] generated = new char[n];
		for(int i=0;i<n;i++) {
			if(i%2==0) generated[i] = 'A';
			else generated[i] = 'B';
		}
		return generated;
	}
	public static char[] generateBA(int n) {
		char[] generated = new char[n];
		for(int i=0;i<n;i++) {
			if(i%2!=0) generated[i] = 'A';
			else generated[i] = 'B';
		}
		return generated;
	}
	static final Random random=new Random();
	//	static void ruffleSort(Pair[] a) {
	//		int n=a.length;//shuffle, then sort 
	//		for (int i=0; i<n; i++) {
	//			int oi=random.nextInt(n);
	//			Pair temp=a[oi];
	//			a[oi]=a[i]; a[i]=temp;
	//		}
	//		Arrays.sort(a);
	//	}
	static void ruffleSort(int[] a) {
		int n=a.length;//shuffle, then sort 
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
	static void ruffleSort(char[] a) {
		int n=a.length;//shuffle, then sort 
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n);
			char temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
	static class FastReader 
	{ 
		BufferedReader br; 
		StringTokenizer st; 

		public FastReader() 
		{ 
			br = new BufferedReader(new
					InputStreamReader(System.in)); 
		} 

		String next() 
		{ 
			while (st == null || !st.hasMoreElements()) 
			{ 
				try
				{ 
					st = new StringTokenizer(br.readLine()); 
				} 
				catch (IOException  e) 
				{ 
					e.printStackTrace(); 
				} 
			} 
			return st.nextToken(); 
		} 

		int nextInt() 
		{ 
			return Integer.parseInt(next()); 
		} 

		long nextLong() 
		{ 
			return Long.parseLong(next()); 
		} 

		double nextDouble() 
		{ 
			return Double.parseDouble(next()); 
		} 

		String nextLine() 
		{ 
			String str = ""; 
			try
			{ 
				str = br.readLine(); 
			} 
			catch (IOException e) 
			{ 
				e.printStackTrace(); 
			} 
			return str; 
		} 

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

//class Pair implements Comparable<Pair>{
//    int a;
//    int b;
//    public Pair(int a, int b) {
//        this.a = a;
//        this.b = b;
//    }
//    public int compareTo(Pair o) {
//        if(this.a==o.a)
//            return this.b - o.b;
//        return this.a - o.a;
//    }   
//}