function Main(input) {
  "use strict";
	const lines = input.split("\n");
  const line1 = lines[0].split(" ");
  let nums = line1.map(s => parseInt(s, 10));
  let k = nums.pop();

  let S = lines[1]
  let c = String(S[k-1]).toLowerCase()
  console.log(S.substring(0,k-1) + c + S.substring(k))
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"))