function Main(input){
    var xs = input.split('\n');
    //console.log(xs);
    var nums = xs[0].split(' ').map(v => parseInt(v, 10));
    //console.log(nums);
    var K = nums[1];
    var S = xs[1];
    var a = S.slice(0, K -1 );
    var b = S[K -1].toLowerCase(); 
    var c = S.slice(K);
    console.log(a+b+c);
  
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));