fun main(args: Array<String>) {

    val (size, pos) = readLine()!!.split(" ").map { Integer.parseInt(it) }
    val str = readLine()!!
    val result = str.mapIndexed { index, char -> if (index == pos - 1) char.toLowerCase() else char }
    val buffer = StringBuilder()
    result.forEach {
        buffer.append(it)
    }
    print(buffer)
}