'use strict'
function Main(input) {
    input = input.split("\n")
    const lineOne = input[0].split(' ').map(str => parseInt(str, 10))
    const S = input[1]
    const K = lineOne[1] - 1
 
    let strings = S.split('')
    strings[K] = strings[K].toLowerCase()
    const result = strings.join('')
    
    console.log(result)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"))