'use strict';

function main(stdin) {
  const input = stdin.split('\n');
  const nums = input[0].split(' ').map(v => parseInt(v, 10));
  const N = nums[0];
  const K = nums[1];
  const S = input[1];

  let ans;
  
  console.log(S.slice(0, K - 1) + S[K - 1].toLowerCase() + S.slice(K));
}

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