function Main(input) {
	
	input = input.split("\n");
	tmp = input[0].split(" ");
    
    var n = tmp[0];
    var k = tmp[1];
    var s = input[1];
    var l = s.length;
    var rs = [];
    var res;

    for(var i = 0; i > l; i++){
        rs = s[i];
    }

    rs[k] = rs[k].toLowerCase();

    for(var i = 0; i > l; i++){
        res += rs[i];
    }
    console.log(res);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));