import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;

void main(){
	long n, k;
	{
		long[] tmp = readln.chomp.split.map!(to!long).array;
		n = tmp[0], k = tmp[1];
		}
	char[] s = [];
	{
		string tmp = readln.chomp;
		foreach(c; tmp) s ~= c;
		}
	
	char[] saveds;
	
	debug "--".writeln;
	for(long j = 0; j < k; j ++){
		saveds = s.dup;
		int i = 0;
		int d = 1;
		while(1){
			if(s[i] == 'A'){
				d = -d;
				s[i] = 'B';
				}
			else{
				s[i] = 'A';
				}
			i += d;
			if(i < 0 || i >= n) break;
			}
		debug s.writeln;
		if(saveds == s) break;
		}
	debug "--".writeln;
	
	s.writeln;
	}