const main = (input) => {
  var inputs = input.trim().split("\n");
  var N = inputs[0].split(" ")[0];
  var K = inputs[0].split(" ")[1];
  var A = inputs[1].split("");
  var ans = "";
  for(var i=0;i<N;i++){
    if(K==i+1) ans += A[i].toLowerCase();
    else ans += A[i];
  }
  console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'UTF-8'));
