fun main(args: Array<String>) {
    val inputs = readInputLine().split(" ").map { Integer.parseInt(it) }
    val s = readInputLine()
    
    val k = inputs[1]

    val charList = s.toCharArray().mapIndexed { i, c -> if (i + 1 == k) {c.toLowerCase()} else {c}}

    var res = ""
    for (c in charList) {
        res = res + c.toString()
    }
    println(res)
}
 
fun readInputLine(): String {
    return readLine()!!
}
