const main = stdin => {
  const input = stdin.trim().split('\n')

  const [N, K] = input[0].split(' ').map(x => parseInt(x))
  const S = input[1]

  let ans = ''
  for (let i = 0; i < N; i++) {
    if (i === K - 1) {
      ans += S[i].toLowerCase()
    } else {
      ans += S[i]
    }
  }

  console.log(ans)
}
// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
