function Main(input) {
	tmp = input.split("\n");
	var a = tmp[0].split(" ");
	var n = parseInt(a[0]);
	var k = parseInt(a[1])-1;
	var s = tmp[1];
	var r = "";
	for (var i = 0 ; i < n ; i++){
		if(i==k){
			if(s.charAt(i) == "A"){ r += "a"; }
			if(s.charAt(i) == "B"){ r += "b"; }
			if(s.charAt(i) == "C"){ r += "c"; }
		}else{
			r += s.charAt(i);
		}
	}
	console.log(r);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));