function main(input) {
  const args = input.split('\n');
  const row = args[0].split(' ');
  const N = row[0],
        K = row[1];
  let S = args[1].split('');
  
  S[K - 1] = S[K - 1].toLowerCase();
  console.log(S.join(''));
  
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));