function main(input) {
  const is = input.split("\n");
  const n = parseInt(is[0].split(" ")[0]);
  const k = parseInt(is[0].split(" ")[1]);
  const s = is[1];

  const chars = s.split('');
  chars[k - 1] = chars[k - 1].toLowerCase();
  console.log(chars.join(''));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));