function main(input) {
  const args = input.split('\n');
  const k = args[0].split(' ')[1];
  let s = args[1].split('');
  
  s[k - 1] = s[k - 1].toLowerCase();
  s = s.join("");
  console.log(s);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));